subject

Create a game of rock paper and scissors in which a player plays either 'Rock', 'Paper' or 'Scissors' and a computer tries to beat the player based on the player's previous moves.

Follow the steps given below:

1. Create a list: ['0', '1', '2'] and store it in the variable called valid_entries, i. e,

valid_entries = ['0', '1', '2'].

2. Create an infinite while loop. Inside the loop, create a variable called user_input to

store the input taken by the player.

3. Use the input() function to take input from a player. Inside the input() function,

write the Enter 0 for ROCK, 1 for PAPER and 2 for SCISSORS: statement to show it

as a message to a player.

4. Write another while loop to check whether the input provided by a player exists in

the valid_entries list or not.

5. If the input provided by a player does not exist in the valid_entries list, then print

Invalid Input! message. In the next line, rewrite the user_input = input("Enter 0 for

ROCK, 1 for PAPER and 2 for SCISSORS: ") statement.

6. Now, outside the inner while loop, convert the user_input value to an integer value

using the int() function.

7. Call the update_scores() function with the user_input as an input to update the

scores of the computer and the player.

8. Call the update_counts() function with the user_input as an input to update the

counts of the inputs provided by the player.

9. Write an if statement to check if the score is 10 for any of the player. If the

comp_score == 10, then print the Computer Won! message and break the loop.

Else if the player_score == 10, then print the You won! message and break the

loop.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
When a presentation is being planned, it is important to ensure that it covers all available information. appeals to the audience. uses multimedia tools. entertains the audience.
Answers: 1
You know the right answer?
Create a game of rock paper and scissors in which a player plays either 'Rock', 'Paper' or 'Scissor...
Questions
question
Mathematics, 01.07.2019 17:00
question
Mathematics, 01.07.2019 17:00
question
Mathematics, 01.07.2019 17:00
question
Spanish, 01.07.2019 17:00
question
Social Studies, 01.07.2019 17:00
question
Mathematics, 01.07.2019 17:00
question
Mathematics, 01.07.2019 17:00