Python program to convert Celsius into Fahrenheit
Python program to convert Celsius into Fahrenheit
This program explains how we can take the temperature in Celsius and convert them into Fahrenheit.
Celsius
Celsius, also known as centigrade, is a measurement unit representing temperature. It is named after the Swedish astronomer Anders Celsius. It is an SI derived unit used by most countries worldwide.
Fahrenheit
It is also used for the measurement of the temperature scale. It is named after Polish-born German physicist Daniel Gabriel Fahrenheit. It uses degrees Fahrenheit as a unit for temperature.
The mathematical formula to convert degree Celsius into degree Fahrenheit is given below:
celsius * 1.8 = Fahrenheit – 32
Example
Input: Temp = 40 degree Celsius Output: Temp = 104 degree Fahrenheit 40 * 1.8 = Fahrenheit – 32 72 + 32 = Fahrenheit Fahrenheit = 104 degree
Source Code:
The following source code converts the Celsius into Fahrenheit:
#Program to convert degree Celsius into degree Fahrenheit #Take the temperature in degree Celsius Temp_celc = float(input("Enter temperature in degree Celsius:")) #Convert into Fahrenheit Fahrenheit = (Temp_celc * 1.8) + 32 #Print result print('%0.1f degree Celsius is equal to %0.1f degrees Fahrenheit' %(Temp_celc, Fahrenheit))
Output
Here is the output:

Explanation: In this program, we will input from the user and store it in a variable. Next, we have applied the conversion formula that converts the temperature in degree Celsius into degree Fahrenheit and stores it in a variable. Finally, it will print the result on the screen.