Question: Using Python, write a program that generates a random number between 1 and 100 using the while loop. Have the user guess the number. Provide

Using Python, write a program that generates a random number between 1 and 100 using the while loop. Have the user guess the number. Provide feedback as to whether the number is too high or too low. Count the number of guesses.

Example:

Enter a number between 1 and 100: 1

Your guess is too low

Enter a number between 1 and 100: 72

Your guess is too high

Enter a number between 1 and 100: 21

You are correct! The number is 21

It took you 3 times to get the right answer!

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!