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...
-
A satellite will travel indefinitely in a circular orbit around a planet if the normal component of the acceleration of the satellite is equal to g(R/r)2, where g is the acceleration of gravity at...
-
Write a program checkLuminance that will input red, green, and blue values, and compute the luminance using the weighted average (as below). But then print out a warning to the user based on the...
-
Listed below are additional research questions and hypotheses from actual published articles. For each hypothesis, identify the independent and dependent variable. a. It is expected that achievement...
-
The Starr Co. just paid a dividend of $2.15 per share on its stock. The dividends are expected to grow at a constant rate of 5 percent per year, indefinitely. If investors require a return of 11...
-
make 1 paragraph in the abstract below, with the journal name Optimizing the thermal management system of PCM fin-structured Li-ion batteries under mechanical vibration conditions: A comparative...
-
Byron Corp. is considering the purchase of a new piece of equipment. The cost savings from the equipment would result in an annual increase in cash flow of $145,000. The equipment will have an...
-
consider pricing a one-year swap on December 11, Year 1, given the following yield information pertaining to floating rates: We would like to use this information to derive the fixed swap rate. The...
-
What role do market makers play in the trading system? How do they profit from this role? How do the market makers compete with one another? How does the NASDAQ quoting convention work How do the...
-
Property worth $330,500.00 can be purchased for 6% down and mortgage payments of $1620.00 at the end of each month for 30 years. What is the nominal annual rate of interest compounded monthly? The...
-
what are five recommendations to improve operations and banking services for the period 2023-2026. A comprehensive review of the first Caribbean international banking services currently offered and...
-
The partnership agreement of Julie and Cathy provides for yearly salary allowances to Julie of $120,000 and to Cathy of $96,000. Each partner will also receive an interest allowance of 10% on their...
-
Calculate (in MeV) the total binding energy for 40Ar. Express your answer using four significant figures. Calculate (in MeV) the binding energy per nucleon for 40Ar. Express your answer using three...
-
Calculate the change in entropy when 100 kJ of energy is transferred reversibly and isothermally as heat to a large block of copper at (i) 0 C, (ii) 50 C.
-
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...
-
What are a manager's resources?
-
What are the three levels of management?
-
What is the glass ceiling?
Study smarter with the SolutionInn App