# 8 – Python program to convert Celsius to Fahrenheit and vice versa

## Python program to convert Celsius to Fahrenheit and vice versa

Celsius : It is a scale to measure temperature named after Anders Celsius and its symbol is °C.

Fahrenheit : It is a scale to measure temperature. It is proposed in 1724 by the physicist Daniel Gabriel Fahrenheit

Following are the simple python programs for conversion. ### Python program to convert Celsius to Fahrenheit

`c = float(input("Enter temperature in Celsius : "))f = (c * 9/5) + 32print("%.2f Celsius is equal to %.2f Fahrenheit" %(c, f))`

Output :

Enter temperature in Celsius : 5
5.00 Celsius is equal to 41.00 Fahrenheit

Enter temperature in Celsius : 37
37.00 Celsius is equal to 98.60 Fahrenheit

### Python program to convert Fahrenheit to Celsius

`f = float(input("Enter temperature in Fahrenheit : "))c = (f - 32) * 5/9print("%.2f Fahrenheit is equal to %.2f Celsius" %(f, c))`

Output :

Enter temperature in Fahrenheit : 41
41.00 Fahrenheit is equal to 5.00 Celsius

Enter temperature in Fahrenheit : 98.6
98.60 Fahrenheit is equal to 37.00 Celsius