
Patrick B. answered 03/08/21
Math and computer tutor/teacher
iTemperatureMenuOption = -1
while (int(iTemperatureMenuOption)<1) or (int(iTemperatureMenuOption)>2):
print(" For Fahrenheit to Celsius, Input 1 ")
print(" For Celsius to Fahrenheit, Input 2 ")
iTemperatureMenuOption =input(" Please input your selection :>")
celsiusTemp = -40.0000
fahrenheitTemp = -40.0000
if (int(iTemperatureMenuOption)==1):
fahrenheitTemp = input("Please input the Fahrenheit Temperature:>")
celsiusTemp = 5.0/9*(float(fahrenheitTemp)-32)
else:
celsiusTemp = input("Please input the Celsius Temperature :>")
fahrenheitTemp = 9.0/5 * float(celsiusTemp) + 32
print(" The fahrenheit temperature is " + str(fahrenheitTemp))
print(" The celsius temperature is " +str(celsiusTemp))
if (float(celsiusTemp)<=-40):
print(" Get inside and warm up! You will get hypothermia!")
if (float(celsiusTemp)>=-40) and (float(celsiusTemp)<=10):
print(" It is cold, Wears a warm jacket")
if (float(celsiusTemp)>10) and (float(celsiusTemp)<=17):
print(" It is mild out. Wear a light jacket. ")
if (float(celsiusTemp)>17) and (float(celsiusTemp)<=29):
print(" It is warm outside ")
if (float(celsiusTemp)>29) and (float(celsiusTemp)<=40):
print(" It is very hot! Drink some water and find some shade")
if (float(celsiusTemp)>40):
print(" We're melting!!! ")