subject

Add the following features to your RPS program: Handle scenario if enters an integer other than 1, 2, or 3. Print "invalid" message and loop again.
Handle the exeption if user enters "abc" or a float. Print "invalid" message and loop again
Keep a counter of how many times the human has won, and how many times comp has won.
After each round, print the outcome and print the counters.
Keep playing until the human or the computer wins twice.
Change your logic to determine the outcome:
Add a 2D list at the top of your code that stores all outcome combinations
Replace your if statement – lookup the outcome from the 2D list
Print a "goodbye" message at the end of the program.
Requirements – Planned Output:
Enter 1 for Rock, 2 for Paper, 3 for Scissors: abc
Please only enter an integer. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 60
Invalid int. Please enter 1, 2, or 3. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 2
You chose paper
The computer chose scissors
You lost.
Human: 0 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 3
You chose scissors
The computer chose paper
Congrats, you won!
Human: 1 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 1
You chose rock
The computer chose scissors
Congrats, you won!
Human: 2 Computer: 1

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
You know the right answer?
Add the following features to your RPS program: Handle scenario if enters an integer other than 1,...
Questions
question
Mathematics, 21.05.2021 22:30
question
Mathematics, 21.05.2021 22:30
Questions on the website: 13722367