Articles

Program to convert temperature from Fahrenheit to Celsius in Python

Program to convert temperature from Fahrenheit to Celsius in Python


In this python programming guide, we are going to learn

  • program to convert temperature from Fahrenheit to Celsius in Python

You may also check our video tutorial on program to convert fahrenheit to celsius in python:

 


Program to convert temperature from Fahrenheit to Celsius in Python

The python program to convert temperature from fahrenheit to celsius is as follows:

 

# Owner : TutorialsInhand Author : Devjeet Roy

f = float(input("Enter temperature in F-Scale: "))

c = 5 * (f-32)/9

print("The tempeature in C-Scale:",round(c,2))

The output of program to convert temperature from Fahrenheit to Celsius in python is as follows:

 

PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter temperature in F-Scale: 87
The tempeature in C-Scale: 30.56

Few important points about this program

1. We take the user input and convert it to float data type.

2. Then we use the formula, C/5 = (F-32)/9 to find the temperature in C Scale.

3. Lastly, we round off the answer upto 2 decimal places.

 

Snapshot for write a python program to convert temperature from fahrenheit to celsius:

write a python program to convert temperature from fahrenheit to celsius

This wraps up our session on program to convert fahrenheit to celsius in python.


Python Conversion Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Devjeet Roy
Full Stack Web Developer & Blockchain Enthusiast
Page Views :    Published Date : Nov 27,2022  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!