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
+2
Answers (1)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Define a function called guessNumber that implements the following game, in which the computer will: • Think of a random number in the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Home » Computers & Technology » 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.