import random computer_choice = 0 player_choice = 0 player_score = 0 computer_score = 0 while True: game = True while game == True: computer_number = random.randint(1,3) if computer_number == 1: computer_choice = "rock" elif computer_number == 2: computer_choice = "paper" elif computer_number == 3: computer_choice = "scissors" player_choice = str(input("rock, paper, or scissors? ")).lower() if player_choice == "rock": player_number = 1 elif player_choice == "paper": player_number = 2 elif player_choice == "scissors": player_number = 3 else: player_choice = str(input("please choose rock, paper, or scissors? ")).lower() print("You choose", player_choice,"and computer choose", computer_choice) if player_number == 2 and computer_number == 3 or player_number == 1 and computer_number == 2 or player_number == 3 and computer_number == 1: print("you lose") computer_score = computer_score + 1 print("player score = ", player_score, ",computer score = ", computer_score) elif player_number == 2 and computer_number == 1 or player_number == 3 and computer_number == 2 or player_number == 1 and computer_number == 3: print("you win") player_score = player_score + 1 print("player score = ", player_score, ",computer score = ", computer_score) elif player_number == computer_number: print("it was a tie") print("player score = ", player_score, ",computer score = ", computer_score) if computer_score == 3: print("computer wins") game = False if player_score == 3: print("You Win!") game = False if not game: play_again = str(input("do you want to play again? y/n ")) if play_again == "y": player_score = 0 computer_score = 0 game = True else: print("bye, play again soon")