Temperature Conversion

From Fahrenheit to Celsius

Identifiers

  • celsius
  • fahrenheit
  • print
  • main
  • eval
  • input
In [3]:
def main():
    celsius = eval(input("What is the Celsius temperature? "))
    fahrenheit = (9/5) * celsius + 32
    print("The temperature is", fahrenheit, "degrees Fahrenheit")
    
main()
What is the Celsius temperature? 22
The temperature is 71.6 degrees Fahrenheit