Question
Write a robust and well-documented (commented) program that requests a floating point number between 10.0 and 20.0 (both inclusive). Use Python's try/except mechanism to print
Write a robust and well-documented (commented) program that requests a floating point number between 10.0 and 20.0 (both inclusive). Use Python's try/except mechanism to print out an error message if the user enters any number outside this range. The program should exit when a valid number (in the given range) is entered.
A sample run would be as follows.
Enter a floating point number between 10.0 and 20.0 (both inclusive): 3 You did not enter a floating point number in the given range. Enter a floating point number between 10.0 and 20.0 (both inclusive): nine You did not enter a floating point number in the given range. Enter a floating point number between 10.0 and 20.0 (both inclusive): 15.62 Your number is 15.62.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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