PART A Write a Python program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the computer’s choice yet.) 2. The user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. (You can use a menu if you prefer.) 3. The computer’s choice is displayed. 4. A winner is selected according to the following rules: a. The rock smashes the scissors. b. Scissors cuts paper. c. Paper wraps rock. d. If both players make the same choice it is a tie. Print who the winner is. Part B: Once you have completed Part A continue playing, keeping track of how many wins, losses and ties. Add an item to the menu that asks if the user wants to Quit. Keep playing until the user selects Quit. Print out the totals. USE COMMENTS. Notes: To generate a random integer 1 ,2 or 3: Import random num=random.randint(1,3)
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
PART A
Write a Python
The program should work as follows.
1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the computer’s choice yet.)
2. The user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. (You can use a menu if you prefer.)
3. The computer’s choice is displayed.
4. A winner is selected according to the following rules: a. The rock smashes the scissors. b. Scissors cuts paper. c. Paper wraps rock. d. If both players make the same choice it is a tie. Print who the winner is.
Part B: Once you have completed Part A continue playing, keeping track of how many wins, losses and ties.
Add an item to the menu that asks if the user wants to Quit.
Keep playing until the user selects Quit. Print out the totals.
USE COMMENTS.
Notes: To generate a random integer 1 ,2 or 3: Import random num=random.randint(1,3)

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images









