Home >>Python Programs >Python program to convert Celsius to Fahrenheit
In this example, we'll see the python program to convert a value from Celsius to Fahrenheit. Celsius is a unit of measurement for temperature. It's also referred to as centigrade. Fahrenheit is also a temperature scale. It uses the degree fahrenheit as a unit for temperature.
Formula:T(℉) = T(℃) x 1.8 + 32Example 1:
# Collect input from the user
celsius = float(input('Enter temperature in Celsius: '))
# calculate temperature in Fahrenheit
fahrenheit = (celsius * 1.8) + 32
print('%0.1f Celsius is equal to %0.1f degree Fahrenheit'%(celsius,fahrenheit))
# Collect input from the user
celsius = float(input('Enter temperature in Celsius: '))
# calculate temperature in Fahrenheit
fahrenheit = (celsius * 1.8) + 32
print('%0.1f Celsius is equal to %0.1f degree Fahrenheit'%(celsius,fahrenheit))