Modify your guessing game.py program from the previous lab as follows: After the player has finished...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Modify your guessing game.py program from the previous lab as follows: After the player has finished the game, ask if they'd like to play again. If so, restart the game with a new random number, without changing the range of possible numbers that was originally entered by the player. After the player finishes each game, show statistics on the lowest, highest, and average number of guesses taken by the player over all games played. The other features (how the game works, input validation, etc.) should be unchanged. Example program run (underlined parts indicate what the user enters) Let's set up our guessing game! I'll pick a random integer between a certain min and max (inclusive) that you specify. Min: 2 Max: 4 OK, let's play! I'm thinking of an integer between 2 and 4, inclusive. Enter your guess: 2 Enter your guess: 2 Woohoo, you got it! It only took you 1 try. You should consider a career in the psychic industry. Your stats so far:. Minimum guesses taken: 1 Maximum guesses taken: 1 Average guesses taken: 1.0 Play again? (Y for yes, anything else for no): Y OK, let's play! I'm thinking of an integer between 2 and 4, inclusive. Enter your guess: 4 Too high! Try again... Enter your guess: 3 Woohoo, you got it! It only took you 2 tries. Your stats so far:: Minimum guesses taken: 1 Maximum guesses taken: 2 Average guesses taken: 1.5 Play again? (Y for yes, anything else for no): N Modify your guessing game.py program from the previous lab as follows: After the player has finished the game, ask if they'd like to play again. If so, restart the game with a new random number, without changing the range of possible numbers that was originally entered by the player. After the player finishes each game, show statistics on the lowest, highest, and average number of guesses taken by the player over all games played. The other features (how the game works, input validation, etc.) should be unchanged. Example program run (underlined parts indicate what the user enters) Let's set up our guessing game! I'll pick a random integer between a certain min and max (inclusive) that you specify. Min: 2 Max: 4 OK, let's play! I'm thinking of an integer between 2 and 4, inclusive. Enter your guess: 2 Enter your guess: 2 Woohoo, you got it! It only took you 1 try. You should consider a career in the psychic industry. Your stats so far:. Minimum guesses taken: 1 Maximum guesses taken: 1 Average guesses taken: 1.0 Play again? (Y for yes, anything else for no): Y OK, let's play! I'm thinking of an integer between 2 and 4, inclusive. Enter your guess: 4 Too high! Try again... Enter your guess: 3 Woohoo, you got it! It only took you 2 tries. Your stats so far:: Minimum guesses taken: 1 Maximum guesses taken: 2 Average guesses taken: 1.5 Play again? (Y for yes, anything else for no): N
Expert Answer:
Related Book For
Modern Advanced Accounting In Canada
ISBN: 9781259066481
7th Edition
Authors: Hilton Murray, Herauf Darrell
Posted Date:
Students also viewed these programming questions
-
If the acceptable range of impurities in this case is from 60 to 120 parts per million, which of these three charts is the fairest way to present the data? Why?
-
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...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
DFI of real sequences with odd harmonics only Let x(n) be an N -point real sequence with N-point DFT X(k) (N even). In addition, x(n) satisfied the following symmetry property: x(n + N/2) = -x(n) n =...
-
Why is Ricardo's explanation of the law of comparative advantage unacceptable? What acceptable theory can be used to explain the law?
-
Discuss specific characteristics that could be monitored through variables control charts, the form of data to collect, and the appropriate control chart in the following situations: (a) Waiting time...
-
Why can subject matter jurisdiction never be waived by the defendant?
-
Tom and Mary James just had a baby. They heard that the cost of providing a college education for this baby will be $100,000 in 18 years. Tom normally receives a Christmas bonus of $4,000 every year...
-
Introduction to Accounting 120 Comprehensive Assignment Use the workbook that you downloaded and saved as Comp_YourName. Include your name and date in the yellow section of the first spreadsheet tab....
-
B52 Skate Training prepares adjustments annually and showed the following on its June 30, 2020, year-end: Additional information available at year-end: a. The Prepaid Arena Rental of $182,000 was...
-
Design the sounding App a) Write an xml for the Item Layout that contains an image and text? 2M 5M b) Adapt the 4 different music images and texts to the GridView? c) Whenever grid item is clicked...
-
Use induction to prove that, for n 1: 2" - 1 2" F 2 We recommend using "Preview My Answer" before clicking "Submit". Proof: We will prove this by induction on n. Basis: Let n = i=1 a= f = i=1 Then...
-
What is meant by "the foundation" of the expert report?
-
Dell Farms Ltd . sold equipment during 2 0 2 2 that had originally been purchased for $ 2 5 2 , 0 0 0 . The equipment had a net book value of $ 1 4 4 , 0 0 0 at the time of the sale when it sold for...
-
Discuss the division of responsibilities of Service Canada for payroll function?
-
Describe the issues that surround the use of city commercial drones with references.
-
A metal surface is illuminated by light of two different wavelengths 248 nm and 310 nm. The maximum speeds of the photoelectrons corresponding to these wavelengths are u and u, respectively. If the...
-
Suppose that a company has 10.000 outstanding shares in the beginning of the year. On April 1st, the company increases its shares by 6.000. On July 1st, the company increases its shares again, but...
-
Required (a) Can any alternative to historical cost provide for fair presentation in financial reports or are the risks too great? Discuss. (b) Discuss the relative merits of historical cost...
-
Describe the difference in accounting under ASPE versus IFRSs for the elimination of unrealized profits in ending inventory on a downstream transaction between an investor and an associate.
-
An interest elimination gain (loss) does not appear as a distinguishable item on a consolidated income statement . Explain.
-
Which of the following best illustrates an error caused by sampling? a. A randomly chosen sample may not be representative of the population as a whole on the characteristic of interest. b. An...
-
The application of statistical sampling techniques is least related to which of the following generally accepted auditing standards? a. The work is to be adequately planned and assistants, if any,...
-
Which of the following is an error caused by sampling? a. Choosing an audit procedure that is inconsistent with the audit objective. b. Choosing a sample size that is too small to achieve the...
Study smarter with the SolutionInn App