Python Program to Convert Celsius to Fahrenheit

Learn via video course
FREE
View all courses
Python Course for Beginners With Certification: Mastering the Essentials
Python Course for Beginners With Certification: Mastering the Essentials
by Rahul Janghu
1000
4.90
Start Learning
Python Course for Beginners With Certification: Mastering the Essentials
Python Course for Beginners With Certification: Mastering the Essentials
by Rahul Janghu
1000
4.90
Start Learning
Topics Covered

Overview

Celsius and Fahrenheit are the measurement units of temperature. °C denotes the temperature on the Celsius scale, and °F denotes the temperature on the Fahrenheit scale.

The relationship between Fahrenheit and Celsius is directly proportional, that is if the value of temperature on the Celsius scale increases, the temperature on the Fahrenheit scale also increases. This can be explained with Python programs to convert Celsius to Fahrenheit and vice versa.

Celsius To Fahrenheit conversion

Celsius To Fahrenheit and Fahrenheit to Celsius Conversion Formulas

Fahrenheit=(Celsius1.8)+32Fahrenheit = (Celsius * 1.8) + 32

Celsius=(Fahrenheit32)/1.8Celsius = (Fahrenheit - 32)/1.8

Example

Convert 10010^0 Celcius to Fahrenheit.

Let us consider the temperature in Fahrenheit to be F0F^0.

Fahrenheit=(Celsius1.8)+32Fahrenheit = (Celsius * 1.8) + 32 F=(101.8)+32=50F = (10 * 1.8) + 32 = 50

Thus, 10 degree Celsius is equal to 50 degree Fahrenheit.

Python Program to convert Celsius to Fahrenheit

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Example 1

Question

Write a Python program to convert 54054^0 Celcius to Fahrenheit.

Code

Output

Approach

The code applies the conversion formula of Fahrenheit from Celsius and displays the final output. The relationship between the Celsius scale and the Fahrenheit scale is given by :

Fahrenheit=(Celsius1.8)+32Fahrenheit = (Celsius * 1.8) + 32

Example 2

Question Write a Python program to convert temperature from Celcius to Fahrenheit. Take input from user.

Code

Output

Approach

The user inputs a Celsius temperature. The code applies the conversion formula of Fahrenheit from Celsius and displays the final output. The relationship between the Celsius scale and the Fahrenheit scale is given by :

Fahrenheit=(Celsius1.8)+32Fahrenheit = (Celsius * 1.8) + 32

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Python Program to Convert Fahrenheit into Celsius

Example 1

Question Write a Python program to convert 86086^0 Fahrenheit to Celcius.

Code

Output

Approach

The code applies the conversion formula from Fahrenheit to Celsius and displays the final output. The relationship between the Fahrenheit scale and the Celsius scale is given by :

Celsius=(Fahrenheit32)/1.8Celsius = (Fahrenheit - 32)/1.8

Example 2

Question Write a Python program to convert temperature from Fahrenheit to Celcius. Take input from user.

Code

Output

Approach

The user inputs a Fahrenheit temperature. The code applies the conversion formula of Celsius from Fahrenheit and displays the final output. The relationship between the Fahrenheit scale and the Celsius scale is given by :

Celsius=(Fahrenheit32)/1.8Celsius = (Fahrenheit - 32)/1.8

Learn More

For better understanding you should have clear knowledge of the following Python programming topics:

Conclusion

  • Celsius and Fahrenheit are the measurement units of temperature.
  • The relationship between them is: (F32)/9=C/5( F - 32 ) / 9 = C / 5 where F is Fahrenheit, and C is Celsius.
  • The Python program to convert Celsius to Fahrenheit uses the formula Fahrenheit=(Celsius1.8)+32Fahrenheit = (Celsius * 1.8) + 32
  • The Python program to convert Fahrenheit to Celsius uses the formula Celsius=(Fahrenheit32)/1.8Celsius = (Fahrenheit - 32)/1.8
  • 1°Celsius = 33.8°F
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more