Question: Write a Python program that generates a random number between 1 and 100, inclusive. This number will act as the target number. After generating this

Write a Python program that generates a random number between 1 and 100, inclusive. This number will act as the target number. After generating this number, your program should print out a prompt, asking the user to guess the number. After storing their guess taken from standard input, your program should then compare their guess to the target number. If the user guesses correctly, inform them that they guessed correctly and exit the program. Otherwise, tell the user whether their guess was higher or lower than the target and prompt them to enter another guess. Continue comparing the users guesses to the target number, giving them a hint, and asking for them to guess again until they correctly guess the number.

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!