Question: Rock, Wall, Paper, Scissors Program in python Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. When

Rock, Wall, Paper, Scissors Program in python

Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. When two people play, each person pumps an arm up and down three times in unison while counting to three (1, 2, 3) out loud. On 3, both players independently shape their hand to resemble either:

a rock by making a fist,

paper by flattening their hand (palm facing down), or

a scissors by sticking out their middle and pointer fingers to form a > shape.

If both players make the same choice, the process is repeated until there is a clear winner. Thus, a tie does not end a game, so multiple gestures might be needed by each player before there is a winner.

On the computer, well need to substitute the text rock, paper, or scissors for the hand gestures. Your program should allow a human player to play rock-paper-scissors against the computer repeatedly. After each game, prompt the user with a question like: Do you want to play again (Y/N)?. When they ultimately quit, your program should output the following statistics:

the number of times the human player won

the number of times that the computer won

the percentage of times that the computer won

the average number of gestures per game to determine a winner overall the games played

For each game the general algorithm youll need to follow is: 1. Have your program randomly chose one of the strings rock, paper, or scissors by using the choice function from the random module. At the top of your program, youll need to import the random module and using the choice function, Then, whenever you want to randomly select one of those strings, call the choice function as:

 computersChoice = random.choice(["rock","paper","scissors"]) 

Dont display the computers choice yet. 2. Prompt the user to enter their choice of rock, paper, or scissors at the keyboard (use input_raw) 3. Display the computers choice and declare a winner based on the above rules.

3. Display the computers choice and declare a winner based on the above rules.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!