Articles

Program to convert temperature from Celsius to Fahrenheit in Python

Program to convert temperature from Celsius to Fahrenheit in Python


In this python programming guide, we will learn to:

  • write a program to convert temperature from celsius to fahrenheit in python

Program to convert temperature from Celsius to Fahrenheit in Python

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

 

# Owner : TutorialsInhand Author : Devjeet Roy

c = float(input("Enter temperature in C-Scale: "))

f = (c * 9)/5 + 32

print("The tempeature in F-Scale:",round(f,2))

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

 

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

Few important tips 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 F Scale.

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

 

Write a program to convert temperature from celsius to fahrenheit in python snapshot:

write a program to convert temperature from celsius to fahrenheit in python

 


Basic Python 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 & Data Science Enthusiast
Page Views :    Published Date : Feb 14,2021  
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!