Question: Please follow these guidelines and label the appropriate things as needed. Also please post screenshots of this running in python, along with screenshots of the

Please follow these guidelines and label the appropriate things as needed. Also please post screenshots of this running in python, along with screenshots of the code. Please use either a for loop or a while loop.

Requirements: 1. Define a function named as play_game. This function receives two parameters representing the players and computers choices, and it returns an integer representing the game result from the players perspective. Specifically, it returns 1 if the player wins and 0 if the player does not win. Hint: you can reuse most of the code of team activity 2 as the body of this function.

2. Define the main function. In the main function, write code to let users play the game multiple rounds against the computer.

1) Option 1: use a for-loop to let the player play this game 3 times. For each round of the game, display a message indicating whether the player wins, loses, or draws. After the player has played 3 times, display a message indicating how many times the player has won.

2) Option 2: use a while loop to let the player play this game multiple times and the loop ends when the player wins 3 times. For each round of the game, display a message indicating whether the player wins, loses, or draws. After the player has won 3 times, display a message informing the player that the player has won 3 out of how many of times played.

3) For either option, within each round of the game:

a. Let the computer randomly make a choice of scissor, rock, and paper. b. Prompt the player to make the players choice. c. Call the play_game function to play the game once. 3. Call the main function and test your code.

Please follow these guidelines and label the appropriate things as needed. Also please post screenshots of this running in python, along with screenshots of the code. Please use either a for loop or a while loop.

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!