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 07:00
What are three software programs for mobile computing?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
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
Biology, 21.06.2019 13:30
question
English, 21.06.2019 13:30
Questions on the website: 13722361