In this tutorial, we will learn how to write a python program for converting degree Celsius temperature into degree Fahrenheit temperature.
Celsius:
Celsius is a unit of measurement for temperature, and it is also known as centigrade, and it is SI derived unit used by most of the countries worldwide.
It is named after the Swedish astronomer Anders Celsius.
Fahrenheit:
Fahrenheit is also a temperature scale, and it is named after Polish-born German physicist Daniel Gabriel Fahrenheit, and it uses degrees Fahrenheit as a unit for temperature.
Suppose we have a temperature in degree Celsius, and our task is to convert the value of temperature into the degree Fahrenheit and display it.
Example:
Input: Temperature value in degree Celsius: 34
Output: The 37.00 degree Celsius is equal to: 93.20-degree Fahrenheit
Input: Temperature value in degree Celsius: 40
Output: The 45.00 degree Celsius is equal to: 113.00-degree Fahrenheit
Approach:
We can input the degree Celsius temperature and apply the conversation formula of degree Fahrenheit from degree Celsius and display it on screen. The following is the relationship of degree Celsius and degree Fahrenheit:
T(°Fahrenheit)=(T(°Celsius)*1.8)+32
OR we can write:
T(°Fahrenheit)=(T(°Celsius)*9/5)+32
Example:
Output:
To Convert Degree Fahrenheit into Degree Celsius:
The user can use the following formula for converting degree Fahrenheit into degree Celsius:
Example:
Output:
Conclusion
In this tutorial, we discussed how to write a Python program for converting degree Fahrenheit to degree Celsius and vice versa.
need an explanation for this answer? contact us directly to get an explanation for this answer