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
Get step-by-step solutions from verified subject matter experts
