subject

Define a function called guessnumber that implements the following game, in which the computer will: • think of a random number in the range 0-50. (hint: use the random module.) • repeatedly prompt the user to guess the mystery number. • if the guess is correct, congratulate the user for winning. if the guess is incorrect, let the user know if the guess is too high or too low. • after 5 incorrect guesses, tell the user the right answer.

the following is an example of correct input and output.

i'm thinking of a number in the range 0-50. you have five tries to guess it.

guess 1? 32

32 is too high

guess 2? 18

18 is too low

guess 3? 24

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being displayed?
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
What is a number system, and what is the total number of digits used in this system called? a number system is a system that uses different (options: a) numbers b) symbols c) codes d) digits e) alphabets) to represent different numbers. the total number of digits used in a number system is known as its (options: 1) processor 2) converter 3) radix 4) least significant digit 5) most significant digit)
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
Consider a list of full names formatted “firstname lastname”, like ["jules verne", "alexandre dumas", "maurice druon"]. write a list comprehension that produces a list with the full names in the format “lastname, firstname”. the resulting list should look like ['verne, jules', 'dumas, alexandre', 'druon, maurice']. the simplest solution may involve a nested comprehension: [ …. for … in [ … for … in … ]].
Answers: 3
You know the right answer?
Define a function called guessnumber that implements the following game, in which the computer will:...
Questions
question
Mathematics, 16.04.2020 00:08
question
World Languages, 16.04.2020 00:08
question
Mathematics, 16.04.2020 00:08
question
Mathematics, 16.04.2020 00:08
question
Mathematics, 16.04.2020 00:08
Questions on the website: 13722363