Python Program to Convert Celsius To Fahrenheit

Formula to convert Celsius to Fahrenheit

1Fahrenheit = (Celsius ∗ 1.8) + 32

Example program

1# Taking celsius input from the user 2celsius = float(input("Please enter temperature value in Celsius: " )) 3 4# For Converting the temperature Celsius to Fahrenheit using the given formula 5fahrenheit = (celsius * 1.8) + 32 6print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit))

Output

1Please enter temperature value in Celsius: 50 250.0 degree Celsius is equal to 122.0 degree Fahrenheit

Formula to convert Fahrenheit to Celsius

1Celsius = ((Fahrenheit-32)*5)/9

Example program

Fahrenheit to Celsius in Python

1fahrenheit= float(input("Please enter temperature value in Fahrenheit: " )) 2celsius = ((fahrenheit-32)*5)/9 3print('%0.1f degree Fahrenheit is equal to %0.1f degree Celsius' %(fahrenheit, celsius))

Output

1Please enter temperature value in Fahrenheit: 150 2150.0 degree Fahrenheit is equal to 65.6 degree Celsius