Complete temperature conversion program

while True:
  a = 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} Celsius to Fahrenheit: {:.2f} ' .format(c,f))      
  elif a == ' 2 ' :
    f = input( ' Please enter the temperature in Fahrenheit: ' )
    c = 5/9*(float(f)-32)
    print( ' {} Convert Fahrenheit to Celsius: {:.2f} ' .format(f,c))
   else :
     break ;

Guess you like

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