Question
Task 2: The actual gameplay of the RPS game will be in another function. Here are the requirements for this second function. The function name
Task 2:
The actual gameplay of the RPS game will be in another function. Here are the requirements for this second function.
The function name will be RPSExecute.
The function will take two arguments called player1 and player2.
Since these arguments will be validated inputs, there are three possible return values:
o Return0ifitisatie o Return1ifthewinnerisplayer1 o Return2ifthewinnerisplayer2
Task 3:
Call the two functions by using the following logic:
Use the Python Input function to get the value for player 1 and validate it using RPSValidate. Make sure that the user only gets three attempts to try the input. Exit the app if they fail.
Do the same for player two.
If you are at this stage, both player inputs should be valid, and they will have been converted to lower case.
Call the RPSExecute function and pass the validated inputs for player 1 and player 2.
Depending on the return value that you get from the RPSExecute function, output the result of the game to the notebook.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started