Question: Create a program of a mini game Number guessing. Ask the user to input an integer from 1 to 1 0 0 . If the

Create a program of a mini game "Number guessing". Ask the user to input an
integer from 1 to 100. If the guess is not correct, reduce the range and ask the
user input again, until the guess is correct and print the number of guess.
[Hint: Using function random to generate the target number]
Q4
Guess a number from 1 to 100: 70
Guess a number from 70 to 100: 87
Guess a number from 87 to 100: 93
Guess a number from 93 to 100: 96
Guess a number from 93 to 96:94
Guess a number from 94 to 96: 95
The guess is correct!!
The answer is: 95
You made 6 guesses
 Create a program of a mini game "Number guessing". Ask the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!