Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started