import random while True: play = input("Would you like to play? (y/n): ") if play.lower() != "y": break player_score = 0 computer_score = 0 while player_score < 3 and computer_score < 3: choice = input("Rock, Paper or Scissors?: ") computer_choice = random.randint(1, 3) if computer_choice == 1: computer_choice = "Rock" elif computer_choice == 2: computer_choice = "Paper" else: computer_choice = "Scissors" print(" ") print("Computer used", computer_choice) print("") if choice == computer_choice: print("Draw") elif choice == "Rock" and computer_choice == "Scissors": print("Rock beats Scissors") player_score += 1 elif computer_choice == "Rock" and choice == "Scissors": print("Rock beats Scissors") computer_score += 1 elif choice == "Paper" and computer_choice == "Rock": print("Paper beats Rock") player_score += 1 elif computer_choice == "Paper" and choice == "Rock": print("Paper beats Rock") computer_score += 1 elif choice == "Scissors" and computer_choice == "Paper": print("Scissors beats Paper") player_score += 1 elif computer_choice == "Scissors" and choice == "Paper": print("Scissors beats Paper") computer_score += 1 print("") print("Player Score =", player_score) print("Computer Score =", computer_score) print("") print("GAME OVER!") if player_score == 3: print("PLAYER WINS") else: print("COMPUTER WINS")