Wins, losses and ties are counted.

This commit is contained in:
2026-08-19 15:50:58 +02:00
parent 79dfe087c6
commit ee1c344da7

View File

@@ -14,6 +14,10 @@ ties = 0
while True: while True:
print(f'''We are going to play a game of Rock, Paper, Scissors!
losses: {losses} wins: {wins} ties: {ties}''')
# Computer choice: # Computer choice:
computer_choice = random.randint(1,3) computer_choice = random.randint(1,3)
@@ -26,11 +30,11 @@ while True:
# Player choice: # Player choice:
player_choice = input('What do you choose? Rock(R), Paper(P), or Scissors(S)?\n>') player_choice = input('What do you choose? Rock(R), Paper(P), or Scissors(S)?\n>')
if player_choice == 'P': if player_choice == 'P' or player_choice == 'p':
player_choice = 'Paper' player_choice = 'Paper'
elif player_choice == 'R': elif player_choice == 'R' or player_choice == 'r':
player_choice = 'Rock' player_choice = 'Rock'
elif player_choice == 'S': elif player_choice == 'S' or player_choice == 's':
player_choice = 'Scissors' player_choice = 'Scissors'
else: else:
print(f'The choice you made ("{player_choice}") is not valid. The program will now exit') print(f'The choice you made ("{player_choice}") is not valid. The program will now exit')