Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Write Python Program Play Guess Number Game Computer Pick Magic Number 1 100 User Try Gues Q35548420

Write a python program to play the “guess the number” game. Thecomputer will pick a magic number between 1 and 100 and the userwill try to guess the number in as few guesses as possible. Theprogram will keep asking for a guess until the magic number isentered by the user. The program will also give hints to the user(hot or cold) based on whether the new guess is closer or furtherto the magic number compared to the previous guess. For the firstguess, it will be assumed the “previous guess” is 50. The programwill output the number of guesses.

Below is a sample run of how the program should proceed:

I am thinking of a number between 1 and 100.Can you guess what the number is?Enter your guess:40Cold!Enter your guess:75Hot!Enter your guess:87Hot!Enter your guess:82You win!You solved it in 4 guesses.

Leave a Reply

Your email address will not be published. Required fields are marked *