Question: Design a program in Python that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:
Design a program in Python that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows: When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Dont display the computers choice yet.) The user enters his or her choice of rock, paper, or scissors at the keyboard. Validate the user input - give an error message and prompt again for invalid input. Input should not be case sensitive (user can enter rock or Rock) The computers choice is displayed as a rock, paper, or scissors. The program should display a message indicating whether the user or the computer was the winner. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cut paper.) If one player chooses paper and the other player chooses rock, then paper wins. (Paper wraps rock.) If both players make the same choice, the game is a draw. Ask the user if they want to play again. Yes should not be case sensitive. Any input other than yes will be considered no. If they do not want to play again, give the statistics of the game: number of games played, number of games won by user, number of games won by computer. You will need to keep track of this with separate variables.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
