Question: Write a python program, where the computer randomly selects a number between 1 and 100. The user is then asked to guess the number. Once

Write a python program, where the computer randomly selects a number between 1 and 100. The user is then asked to guess the number. Once the user enters a number, the computer will respond with higher or lower if the users guess is higher or lower than the computers number. The number of guesses allowed are limited to 7. If the user guesses the number within 7 tries then print out a congratulatory message Congratulations! You have guessed the right number and end the program. If the user is unable to guess the number before their turns are finished, then print out a message telling the user Unfortunately! You have failed. The correct number was and then ask the user if he wants to play again. If the user says no, end the program.

Define new functions and call them/use them in the code

Use of control flow (conditional statements).

Use of repetitional statements (for or while loop)

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!