Python Program to Convert Centigrade to Fahrenheit

Python program to convert centigrade to fahrenheit can be implemented by using following formula


$F = 32+\frac{9*C}{5}$


Here, value of $F$ is the temperature in fahrenheit while $C$ is the temperature in centigrade.

Fahrenheit and Centigrade are two well known temperature scales. Both of them are used regularly in daily temperature measurements. By using above formula, the following Python program produces output in fahrenheit ($^{\circ}F$) while taking centigrade ($^{\circ}C$) as input.






1. Python Program & output of to convert centigrade to fahrenheit

Code has been copied
# ***************************************************
#             alphabetacoder.com
# Python program to convert Centigrade to Fahrenheit
# ***************************************************

# take input in centigrade
c = float(input("Enter the temperature in centigrade = "))

# convert to fahrenheit
f = 32(9 * c) / 5

print("Temperature is ", f, " in fahrenheit when ", c, " in centigrade.")

Output


Enter the temperature in centigrade = 30

Temperature is 86.0 in fahrenheit when 30.0 in centigrade.