Write a program to display a customized message based on temperature T
input1 input2
-50.5 5.7
output output
Freezing weather Very Cold weather
def get_weather_report (T):
if T<0:
return "Freezing weather"
if T>=0 and T<10:
return "Very cold weather"
if T>=10 and T<20:
return "Cold weather"
if T>=20 and T<30:
return "Normal weather"
if T>=30 and T<40:
return "Hot weather"
if T>=40:
return "Very hot weather"
T= float(input())
print(get_weather_report(T))
Comments
Leave a comment