In this program, you’ll learn to convert Celsuis to Fahrenheit and display it.
To understand this example, you should have the knowledge of the following Python programming topics:
In the program below, we take a temperature in degree Celsius and convert it into degree Fahrenheit. They are related by the formula:
celsius * 1.8 = fahrenheit - 32
Source Code
# Python Program to convert temperature in celsius to fahrenheit
# change this value for a different result
celsius = 37.5
# calculate fahrenheit
fahrenheit = (celsius * 1.8) + 32
print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit)
Output
37.5 degree Celsius is equal to 99.5 degree Fahrenheit
We encourage you to create a Python program to convert Fahrenheit to Celsius on your own using the following formula
celsius = (fahrenheit - 32) / 1.8
Related posts:
Python Dictionary copy()
Python bytes()
Python dict()
Python Set symmetric_difference_update()
Python break and continue
Python Program to Convert Kilometers to Miles
Python String istitle()
Python Program to Get the File Name From the File Path
Python hex()
Python String isspace()
Python List extend()
Python String count()
Python Program to Check if a Number is Positive, Negative or 0
Python Program to Represent enum
Python RegEx
Python List remove()
Python Global, Local and Nonlocal variables
Python String rpartition()
Python List append()
Python Namespace and Scope
Python bool()
Python property()
Python Program to Generate a Random Number
Python Set symmetric_difference()
Python Program to Measure the Elapsed Time in Python
Python Program to Check the File Size
Python Program to Check Prime Number
Python Program to Display Calendar
Python Program to Multiply Two Matrices
Python Dictionary pop()
Intelligent Projects Using Python - Santanu Pattanayak
Python String swapcase()