Python program to enter the temperature in Fahrenheit and convert it to Celsius
ADVERTISEMENTS
Python program to enter the temperature in Fahrenheit and convert it to Celsius. There are you will learn how to convert the temperature in Fahrenheit and convert it to Celsius in Python language.
Formula:
C = (F - 32) * 5/9
Where:
F = fahrenheit
C = celsius
Let us understand this example through Python program:
# Python program to convert the temperature from degree fahrenheit to celsius
print("Enter the temperature in Fahrenheit::")
c, f = None, float(input())
# c = celsius
# f = fahrenheit
# Conversion of fahrenheit to celsius
c = (float)((f - 32) * 5 / 9)
# Output
print("\n", f, " Fahrenheit = ", c, " Celsius\n")
Output Screen:
Enter the temperature in Fahrenheit::
7
7.0 Fahrenheit = -13.88888888888889 Celsius