optional

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: ' ))
     print ( ' Fahrenheit {:.2f} in Celsius is {:.2f} ' .format(f,c))

 

Guess you like

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