Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started