From ee1c344da7c098f7fd1f2834ac77e70f4ec9513d Mon Sep 17 00:00:00 2001 From: marcv Date: Wed, 19 Aug 2026 15:50:58 +0200 Subject: [PATCH] Wins, losses and ties are counted. --- wip_rock-paper-scissors.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wip_rock-paper-scissors.py b/wip_rock-paper-scissors.py index 7ed9caf..c1950f1 100644 --- a/wip_rock-paper-scissors.py +++ b/wip_rock-paper-scissors.py @@ -14,6 +14,10 @@ ties = 0 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 = random.randint(1,3) @@ -26,11 +30,11 @@ while True: # Player choice: 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' - elif player_choice == 'R': + elif player_choice == 'R' or player_choice == 'r': player_choice = 'Rock' - elif player_choice == 'S': + elif player_choice == 'S' or player_choice == 's': player_choice = 'Scissors' else: print(f'The choice you made ("{player_choice}") is not valid. The program will now exit')