The Saffir-Simpson Hurricane Scale (SSHS) classifies the intensity of a hurricane. If you know the wind speed (in miles per hour) you can use the table below to find out what category the hurricane is:
Your task is to make a program that uses this table! Your program, called `hurricane.py`, will ask the user for the wind speed in miles per hour (mph) and print out the hurricane category based on the SSHS. The wind speeds in the table above are inclusive, meaning that wind is in Category 1 if it's 74 mph and above, but under 96 mph. Of course, the `if` statement is really useful here so try to also make use of `elif` and `else` in your statement!
-!- CODE language-text -!-Enter wind speed (mph): 140
That's a Category 4.
Enter wind speed (mph): 5
Just wind.
CodeGrade is your virtual teaching assistant in your Python classroom. You teach, CodeGrade takes care of the rest.
Our 35 built-in fully automatically graded Introduction to Programming assignments are designed especially for middle school and high school coding education, in close collaboration with Harvard-Westlake School (Los Angeles, CA). You can start teaching Python at your school with confidence now. Or, easily scale your classroom with CodeGrade's tools.
Book a personal 30-minute demo now and we'll show you how to get started with CodeGrade in less than 1 hour!