Dice-rolling game doesn't change results
Question: Doing a dice Rolling game in python, and whenever I start my second round I
still end up getting the same dice results from the previous round.

    
    
    import random
    import time
    
    #gets the dice side
    def roll_dice(sides):
        dice_results = list()
        for side in sides:
            roll_result = random.randint(1,side+1)
            dice_results.append(roll_result)
        return dice_results
    
    #pulls a dice out from the list
    def dice_fell(roll_result):  
        player1_dice = player1_dice_results
        player2_dice = player2_dice_results
    
        for item in player1_dice:
            if item % 4 == 0:
                player1_dice.remove(item)
            return player1_dice
    
        for item in player2_dice:
            if item % 4 == 0:
                player2_dice.remove(item)
                return player2_dice
    # variables 
    
    dice_set1=[4, 6, 8, 10, 12, 20, 100]
    dice_set2=[4, 6, 8, 10, 12, 20, 100]
    
    player1_dice_results = roll_dice(dice_set1)
    player2_dice_results = roll_dice(dice_set2)
    
    player1_final_results = dice_fell(player1_dice_results)
    player2_final_results = dice_fell(player2_dice_results)
    
    player1_total= sum(player1_dice_results)
    player2_total= sum(player2_dice_results)
    
    player1_score = 0
    player2_score = 0
    
    while player1_score < 3 or player2_score < 3:
    # This part just announces what happens 
    
        exit= input(str("Press Enter to start! Press 'q' to leave after each round! \n"))
        if exit != "q":
            print("Let's begin! Be careful for the small table!")
        elif exit == "q":
            quit()
    
        print("You are rolling...")
        time.sleep(2)
        print("You have rolled: ",player1_final_results)
    
        if len(player1_final_results) < 7:
            print("Sorry player 1, some of your dice have fallen off the table!")
    
        print()
        print("Your total is: ",player1_total)
        print()
    
        print("Player 2 is rolling...")
        time.sleep(2)
        print("Player 2 has rolled:" ,player2_final_results)
        if len(player2_final_results) < 7:
            print("Sorry player 2, some of your dice have fallen off the table!")
        print()
        print("Player 2's total is: ",player2_total)
        print()
    
        if player1_total > player2_total:
            print()
            print("You have won the round with,",player1_total,"!"),
            player1_score += 1
            print("Your score is: ",player1_score)
        elif player2_total > player1_total:
            print()
            print("Player 2 has won the round with,",player2_total,"!"),
            player2_score += 1
            print("Player 2's score is: ",player2_score)
    
        if player1_score == 3:
            print("Congratulations, you won!")
        elif player2_score == 3:
            print("Player 2 wins! Better luck next time champ!")
    


Answer: I believe that I've fixed the indentation problems. I _have_ reproduced the
problem. As Kevin said, your immediate problem is that you roll the dice only
once, _before_ you enter your **while** loop. Here's what it looks like with
the rolls inside the loop, but after the player decides whether to continue.

    
    
    dice_set1=[4,6,8,10,12,20,100]
    dice_set2=[4,6,8,10,12,20,100]
    
    player1_score = 0
    player2_score = 0
    
    while player1_score < 3 or player2_score < 3:
        # This part just announces what happens
    
        exit = raw_input(str("Press Enter to start! Press 'q' to leave after each round! \n"))
        if exit != "q":
            print("Let's begin! Be careful for the small table!")
        elif exit == "q":
            quit()
    
        player1_dice_results = roll_dice(dice_set1)
        player2_dice_results = roll_dice(dice_set2)
    
        player1_final_results = dice_fell(player1_dice_results)
        player2_final_results = dice_fell(player2_dice_results)
    
        player1_total= sum(player1_dice_results)
        player2_total= sum(player2_dice_results)
    
        print("You are rolling...")
        ... # remainder of code omitted
    

* * *

That said, do note that you have several other problems with the program. You
won't terminate until _both_ players have won three times -- use **and**
instead of **or** in the **while** condition.

Most of my other comments are more appropriate for the codeReview group; you
might post there when you're done debugging.

