Question
temp = eval(input('Enter the temperature in degrees fahrenhiet: ')) velocity = eval(input('Enter the wind in miles per hour: ')) if (temp > 41) or (temp
temp = eval(input('Enter the temperature in degrees fahrenhiet: ')) velocity = eval(input('Enter the wind in miles per hour: ')) if (temp > 41) or (temp < -58): print('The temperature is not in the range of 41 to -58 degrees.') elif(velocity < 2): print('The windspeed is to light.') else: WindChill = 35.74 + 0.6215 * temp - 35.75 * velocity**0.16 + 0.4275 * temp * velocity**0.16 print ('The windchill index:,', format(WindChill,'.1f'))
Using the program above, use one exeption to catch the user entering a character instead of a number. Use an existing exception class for this error. For entering a temperature or windspeed out of the acceptable range (-58 to 41 degrees and it has to be greater than 2 mph wind), have one exception clause cover both and raise the exception with the appripriote text to indicate the error.
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