write a program which does the following: . Prompt the first player to enter the hand...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
write a program which does the following: .• Prompt the first player to enter the hand where they want to hide the coin. The player must imput "I" for left, or "r" for right in the console. • Prompt the second player to guess the hand where the coin is hidden. Just like the previous player, player 2 must imput "I" for left, or "r" for right in the console. • The console will ask for inputs until the players enters the correct one ("I" or "r"). • Print the player who wins the round. • Print the player who wins 3 rounds first. Hint: You will need nested loops for this code. Sample Run Sample input and output (input typed by the user is shown in green text): Round 1: Playerl, Hide coin in left or right hand? (1/r): 1 Player2, Guess! Left or right hand? (1/r): r Player2, You guessed it wrong! Round 2: Playerl, Hide coin in left or right hand? (1/r): r Player 2, Guess! Left or right hand? (1/2): w Player2, Please make a valid guess! Left or right hand? (1/r): r Player 2, You guessed it correctly! Round 3: Playerl, Hide coin in left or right hand? (1/r): 1 Player2, Guess! Left or right hand? (1/r): 1 Player2, You guessed it correctly! Round 4: Playerl, Hide coin in left or right hand? (1/r): r Player2, Guess ! Left or right hand? (1/r): I Player2, You guessed it correctly! Player 2 wins! write a program which does the following: .• Prompt the first player to enter the hand where they want to hide the coin. The player must imput "I" for left, or "r" for right in the console. • Prompt the second player to guess the hand where the coin is hidden. Just like the previous player, player 2 must imput "I" for left, or "r" for right in the console. • The console will ask for inputs until the players enters the correct one ("I" or "r"). • Print the player who wins the round. • Print the player who wins 3 rounds first. Hint: You will need nested loops for this code. Sample Run Sample input and output (input typed by the user is shown in green text): Round 1: Playerl, Hide coin in left or right hand? (1/r): 1 Player2, Guess! Left or right hand? (1/r): r Player2, You guessed it wrong! Round 2: Playerl, Hide coin in left or right hand? (1/r): r Player 2, Guess! Left or right hand? (1/2): w Player2, Please make a valid guess! Left or right hand? (1/r): r Player 2, You guessed it correctly! Round 3: Playerl, Hide coin in left or right hand? (1/r): 1 Player2, Guess! Left or right hand? (1/r): 1 Player2, You guessed it correctly! Round 4: Playerl, Hide coin in left or right hand? (1/r): r Player2, Guess ! Left or right hand? (1/r): I Player2, You guessed it correctly! Player 2 wins!
Expert Answer:
Answer rating: 100% (QA)
Python def hidecoin Prompts the first player to enter the hand where they want to hide the coin player1input inputPlayer1 Hide coin in left or right hand 11 while player1input not in 1 r player1input ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Prepare balance sheets for 2 0 2 0 and 2 0 2 1 in accordance with the format reviewed in class ( left column and right column ) . Prepare an income statement for 2 0 2 1 in accordance with the format...
-
Anne Sugar makes large ceramic pots for use in outdoor landscaping. She currently has two models, one square and the other round. Because of the size of Anne's creations, only one pot can be fired in...
-
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...
-
make a stored procedure called projects_at_this_location that receives a location and returns the projects (if any) at that location as shown in the following sample run: (2 points) exec...
-
Why has Dalian Wanda Group expanded internationally at such a fast rate? How do the acquisitions made fit into the company's strategy overall?
-
Which of the following describes a bond with a call feature? a. It is attractive because the immediate receipt of principal plus premium produces a high return. b. It is more likely to be called when...
-
8. Question: DatagraphiX manufactured and sold computer graphics equipment that allowed users to transfer large volumes of information directly from computers to microfilm. Customers were required to...
-
Gator Co. invested $1,000,000 in Demo Co. for 25% of its outstanding stock. Demo Co. pays out 40% of net income in dividends each year.InstructionsUse the information in the following T-account for...
-
Please see attachment below and help:. If a company sells its receivables and the associated collection risks to another firm, it is using a method called: O Accounts receivable reclamation O...
-
The State of Delaware is the corporate haven of the United States. More than 50 percent of the publicly traded corporations in America, including 60 percent of the Fortune 500 companies, are...
-
Explain why chronic diseases have increased over time. Describe modern medicines strategy against diseases. And describe how we use modern medicine to cope with the disease.
-
What are your sales objectives? What extra information about Mr Forbes would be useful to have?
-
Chris Cole believes the auditor's responsibilities for confirming accounts payable are the same as for accounts receivable. Do you agree with Chris? Explain.
-
a. Identify the substantive tests that apply to the completeness assertion for accounts payable. b. For each of the foregoing tests, indicate the other assertions to which they may relate.
-
Distinguish among the following tests and indicate the assertions to which each test pertains: a. Vouch recorded payables to supporting documentation. b. Examine subsequent payments. c. Determine...
-
a. Explain several control environment factors that impact the production cycle. b. Identify several unique elements of an entity's accounting information system that pertain to the production cycle.
-
Your all-equity firm will have $155,000 in free cash flow to shareholders next year. The cost of equity is 13% and cost of debt is 6%. The long-term growth in FCF is 2%/year, forever. Assume no...
-
Is it ethical to provide safety training in English to immigrant workers who speak little English, in order to reduce costs?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Skyler is covered by his company's health insurance plan. The health insurance costs his company $3,500 a year. During the year, Skyler is diagnosed with a serious illness and the health insurance...
-
Russell (age 50) and Linda (age 45) Long have brought you the following information regarding their income and expenses for the current year. Russell owns and operates a landscaping business called...
-
NBC has the rights to televise the Winter Olympics in two years, and is trying to estimate the value of these rights for possible sale to another network. NBC expects it to cost \($40\) million (in...
-
Cyclops Inc., a high-technology company specializing in state-of-theart visual technology, is considering going public. While the company has no revenues or profits yet on its products, it has a...
-
You have been asked to analyze the value of an oil company with substantial oil reserves. The estimated reserves amount to 10 million barrels, and the estimated cost of developing these reserves...
Study smarter with the SolutionInn App