top of page

Data Scientist Program


Free Online Data Science Training for Complete Beginners.

No prior coding knowledge required!

Fahrenheit to Celsius Conversion with Python

Generally to measure the temperature we make use of one of these two popular units. Fahrenheit & Celsius.

Converting one into another is usually boring and can be easily automated. Today we will be building a simple & short project which will convert Fahrenheit to Celsius for us in seconds.

So the first thing we are going to do is to ask the user for the temperature in Fahrenheit to convert it into the Celsius.

temp = float(input("Enter a temperature in Fahrenheit: "))

We will convert the temperature into float using float() so that we can perform calculations on it.

Now finally let's perform calculation and convert the temperature into Celsius.

celsius = (temp - 32) * 5/9

This expression you see above is the general formula to convert Fahrenheit into Celsius.

Now finally let's print our temperature in Celsius:

print("Temperature {} in Fahrenheit is equal to {} in Celsius".format(temp, celsius))

Here we go we are done!


Recent Posts

See All


Data Insight
Data Insight
Sep 19, 2021

You didn't provide any example of the use of your code.

Magdy Ahmed
Magdy Ahmed
Sep 22, 2021
Replying to

Thank you for pointing this out

I'll take it into consideration

bottom of page