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