Design and make Python program to play Rock, Paper, Scissors. Direction found here: I need word doc,
Fantastic news! We've Found the answer you've been seeking!
Question:
Design and make Python program to play Rock, Paper, Scissors.
Direction found here:
I need word doc, python program and output
Transcribed Image Text:
#generate random num between (inclusive) 1 & 3 comp_choice = random.randint (1, 3) Create a python program for the following rules: Rock wins against scissors. Scissors win against paper. Paper wins against rock. Same pick, tie . Requirements - Write a program that plays Rock, Paper, Scissors. Ask the user for their choice of Rock, Paper, or Scissors (you can ask them for a number 1, 2, or 3). Have the computer also "choose" Rock, Paper, or Scissors (use the randint function from the Python random module). Print what the user chose and what the computer chose, and the outcome of the round. You will need the import at the start of your code and use the random generator in your program. #import the random module import random Output sample: Enter 1 for Rock, 2 for Paper, 3 for Scissors: 2 You chose paper The computer chose scissors You lost. Try again! Name: Enter 1 for Rock, 2 for Paper, 3 for Scissors: 1 You chose rock The computer chose rock You tied. Try again! Enter 1 for Rock, 2 for Paper, 3 for Scissors: 3 You chose scissors The computer chose paper. Congrats, you won! Good bye. Design - IPO- What is the input from the user? Variable Name Page Data Type 1 > of 2 ZOOM + #generate random num between (inclusive) 1 & 3 comp_choice = random.randint (1, 3) Create a python program for the following rules: Rock wins against scissors. Scissors win against paper. Paper wins against rock. Same pick, tie . Requirements - Write a program that plays Rock, Paper, Scissors. Ask the user for their choice of Rock, Paper, or Scissors (you can ask them for a number 1, 2, or 3). Have the computer also "choose" Rock, Paper, or Scissors (use the randint function from the Python random module). Print what the user chose and what the computer chose, and the outcome of the round. You will need the import at the start of your code and use the random generator in your program. #import the random module import random Output sample: Enter 1 for Rock, 2 for Paper, 3 for Scissors: 2 You chose paper The computer chose scissors You lost. Try again! Name: Enter 1 for Rock, 2 for Paper, 3 for Scissors: 1 You chose rock The computer chose rock You tied. Try again! Enter 1 for Rock, 2 for Paper, 3 for Scissors: 3 You chose scissors The computer chose paper. Congrats, you won! Good bye. Design - IPO- What is the input from the user? Variable Name Page Data Type 1 > of 2 ZOOM +
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Harpo Marks Corporation produces and sells forklift trucks. Model 17A (the Chico) has a list price of $ 70,000. The production cost for the 20 finished Chicos in inventory at the end of 20X4 was $...
-
Under IFRS, components of an asset may have different depreciation methods. Prime Printers Ltd. shows the following information about its special printing unit for banners on a spreadsheet that...
-
Why can asymmetric information between buyers and sellers lead to market failure when a market is otherwise perfectly competitive?
-
You have been meeting with a potential new customer regularly for three months. She likes the product but finally admits a loyalty to the existing supplier. The buyer says, I have known Judith...
-
At a certain university in the United States, 62% of the students are at least bilingual- speaking English and at least one other language. Of these students, 80% speak Spanish and, of the 80% who...
-
Answer the following questions about the search problem shown above. For answering a path, please give your answers in the form 'A-D-G'. *Note: A is the initial state and G is the goal state. a) What...
-
The following is summary of information presented on financial performance of Delta Company on December 31, 2021. Accounts 2021 Net Sales $7,000 Cost of Goods Sold $3,800 Selling Expenses $950...
-
How do groups handle risk? What is a risky shift? What is a conservative shift?
-
Describe empowering leadership and explain how it differs from other theories of leadership.
-
Describe servant leadership and explain how it differs from other theories of leadership.
-
When should an organization establish legitimacy and what are the ways that an organization can achieve legitimacy?
-
Compare and contrast ambidextrous, virtual, and modular organizations. What are the advantages and disadvantages of each form of structure?
-
Calculate the free cash flow for Hartline, Inc., based on the following information: EBIT is $6,100 Net operating profit after tax is $4,300 Net operating working capital is $100 Net operating long...
-
Distinguish between the work performed by public accountants and the work performed by accountants in commerce and industry and in not-for-profit organisations.
-
Assume mystring references a string. Write a statement that uses a slicing expression and displays the first 3 characters in the string.
-
If you were to look at a machine language program, you would see _________. a. Java source code b. A stream of binary numbers c. English words d. Circuits
-
Write code that prompts the user to enter a positive nonzero number and validates the input.
-
The data in Table 2 represent the results of a survey in which 200 people were asked their means of travel to work. (a) Use the survey data to build a probability model for means of travel to work....
-
(a) Simulate the experiment of sampling 100 three-child families to estimate the probability that a three-child family has two boys. (b) Simulate the experiment of sampling 1000 three-child families...
-
Our number system consists of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Because we do not write numbers such as 12 as 012, the first significant digit in any number must be 1, 2, 3, 4, 5, 6, 7, 8,...
Study smarter with the SolutionInn App