Write a Python program to convert temperature in Celsius to Fahrenheit

In this source code example, we will write a Python program to convert temperature in Celsius to Fahrenheit.

Write a Python program to convert temperature in Celsius to Fahrenheit

# change this value for a different result
celsius = 30.5
# calculate fahrenheit
fahrenheit = (celsius * 1.8) + 32
print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit))

Output:

30.5 degree Celsius is equal to 86.9 degree Fahrenheit




Comments