Program to convert temperature from Celsius to Fahrenheit in Python

Articles

# 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``````

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:

Python Conversion Programs

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