Question: Write a program that searches for a number in a given range by subdividing the range and asking the user whether the number is higher

Write a program that searches for a number in a given range by subdividing the range and asking the user whether the number is higher or lower. For example (if I was thinking of the number 13 and the range was 20), the program would first guess that my number was 10 and then ask if the value was higher or lower. If I respond by saying 'higher', the program would then guess 15 and repeat the process until the number is found. Use the 'break' statement to terminate execution once the user indicates the number to be correct. Use Python

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!