Celsius to Fahrenheit conversion

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 ( ' {:.2f}°C converted to Fahrenheit {:.2f}°F ' .format(c,f))
 else :
    f = float(input( ' Please enter the temperature in Fahrenheit: ' ))
    c = 5/9*(f-32 )
     print ( ' {:.2f}°F converts to Celsius as {:.2f}°C ' .format(f,c))

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324867218&siteId=291194637