Python Program to Convert Celsius to Fahrenheit
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 and Fahrenheit to Celsius Conversion Formulas
Example
Convert Celcius to Fahrenheit.
Let us consider the temperature in Fahrenheit to be .
Thus, 10 degree Celsius is equal to 50 degree Fahrenheit.
Python Program to convert Celsius to Fahrenheit
Example 1
Question
Write a Python program to convert 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 :
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 :
Python Program to Convert Fahrenheit into Celsius
Example 1
Question Write a Python program to convert 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 :
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 :
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: where F is Fahrenheit, and C is Celsius.
- The Python program to convert Celsius to Fahrenheit uses the formula
- The Python program to convert Fahrenheit to Celsius uses the formula
- 1°Celsius = 33.8°F