Python Program to Convert Fahrenheit to Celsius

To convert Celsius to Fahrenheit we are going to use the formula “C = (F – 32)/1.8“. We will take Fahrenheit temperature as input from the user, apply the conversion formula of Celsius from Fahrenheit, and display the result.

Python3




# Temperature in Fahrenheit degree
fahrenheit = 104
 
# Converting the temperature to
# fehrenheit
celsius = (fahrenheit-32)/1.8
 
# printing the result
print('%.2f Fahrenheit is equivalent to: %.2f Celsius'
      % (fahrenheit ,celsius))


Output

104.00 Fahrenheit is equivalent to: 40.00 Celsius


Taking input from the user to Convert Fahrenheit to Celsius in Python

In the below example, we will simply take temperature input from the user in Fahrenheit and then applied the conversion formula and after that, we print the result.

Python3




fahrenheit = float(input("Enter temperature in fahrenheit: "))
 
celsius = (fahrenheit - 32)/1.8
 
print(str(fahrenheit )+ " degree Fahrenheit is equal\
to " + str(celsius ) + " degree Celsius." )


Output:

Enter temperature in fahrenheit: 140
140.0 degree Fahrenheit is equalto 60.0 degree Celsius.


Python Program to Convert Celsius To Fahrenheit

In temperature conversions, it is often necessary to convert temperatures between different scales. One common conversion is from Celsius to Fahrenheit and vice-versa. In this article, we will see how to convert Celsius to Fahrenheit and vice-versa.

Input1: 40 Celsius
Output1: 104.00 Fahrenheit
Input2: 140 Fahrenheit
Output2: 60 Celsius

We would be given the temperature in Celsius or Fahrenheit and our task will be to convert the temperature value in the Fahrenheit or Celsius scale and display it.
To convert the temperature from Celsius to Fahrenheit or vice versa in Python firstly we will take the input in Celsius or Fahrenheit and then convert that temperature to another unit using the required formula and then print the output.

Similar Reads

Convert Celsius to Fahrenheit using Python

To convert Celsius to Fahrenheit we are going to use the formula “F = (C * 9/5) + 32″. We will take Celsius temperature as input from the user, apply the conversion formula of Fahrenheit from Celsius, and display the result. We have used “%.2f” to represent the floating point number up to two decimal places in Python....

Python Program to Convert Fahrenheit to Celsius

...

Contact Us