a = int (input( ' To convert from Celsius to Fahrenheit please press 1\nTo convert from Fahrenheit to Celsius please press 2\n ' )) if a == ' 1 ' : c = float (input( ' Please enter the temperature in Celsius: ' )) f = c* 9 / 5 + 32 print( ' Celsius {:.2f} is Fahrenheit {:.2f} ' .format(c,f)) else : f = float (input( ' Please enter the temperature in Fahrenheit: ' )) c = 5/9*(f-32) print( ' Fahrenheit {:.2f} is Celsius {:.2f} ' .format(f,c))
Understanding data types and math: summation, temperature conversion 2
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=324867325&siteId=291194637
Ranking