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 bin()
Python Program to Create a Long Multiline String
Python List sort()
Python Program to Find the Square Root
Python List copy()
Python String upper()
Python Set copy()
Python Program to Get a Substring of a String
Python repr()
Python locals()
Python Modules
Intelligent Projects Using Python - Santanu Pattanayak
Python Program to Trim Whitespace From a String
Python Program to Make a Flattened List from Nested List
Python Program to Find the Factorial of a Number
Python Program to Get the File Name From the File Path
Python Program to Transpose a Matrix
Python Keywords and Identifiers
Python Program to Measure the Elapsed Time in Python
Python __import__()
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Python String expandtabs()
Python Program to Concatenate Two Lists
Python delattr()
Python List insert()
Python compile()
Python String format()
Python String translate()
Python String partition()
Python Dictionary keys()
Python String join()
Python Program to Check Armstrong Number