Question:
Write a python program to convert Fahrenheit to Celsius
Program:
1 2 3 4 5 |
Fahrenheit = int(raw_input("Enter a temperature in Fahrenheit: ")) Celsius = (Fahrenheit - 32) * 5.0/9.0 print "Temperature:", Fahrenheit, "Fahrenheit = ", Celsius, " C" |
Explanation:
To convert the temperature from Fahrenheit to Celsius, deduct 32, then multiply by 5, then divide by 9.
Output:
1 2 3 |
Enter a temperature in Fahrenheit: 65 Temperature: 65 Fahrenheit = 18.333333333333332 C |
Leave a Reply