Question: Using Python: Write a number guessing program. You should think of a number between 1 and 100. Then, over and over again, the computer can

Using Python:

Write a number guessing program. You should think of a number between 1 and 100. Then, over and over again, the computer can suggest an answer. If that answer is too small, you enter the character >. If the computer's answer is too large, you enter the character <. If the computer's answer is just right, you print "You win!" First write a program to play this game once, until the computer wins. After that is working, write a program that plays the game over and over, each time with a different number. You can use the random number generator to generate the numbers. Count the number of guesses for each game, and print the average number of guesses. There is a slow algorithm for finding the number, and a faster algorithm. The slow algorithm is acceptable, but the fast algorithm is much better. Use the fastest algorithm you can think of. 

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!