Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago