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 Program to Find Hash of File
Python List
Python Program to Check Leap Year
Python Tuple count()
Python Program to Count the Number of Each Vowel
Python Numbers, Type Conversion and Mathematics
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Python __import__()
Python List extend()
Python String lstrip()
Python delattr()
Python String count()
Python memoryview()
Python Machine Learning - Sebastian Raschka
Python Program to Create a Long Multiline String
Python String swapcase()
Python Program to Copy a File
Python pass statement
Python Program Read a File Line by Line Into a List
Python Machine Learning Second Edition - Sebastian Raschka & Vahid Mirjalili
Python Deep Learning - Valentino Zocca & Gianmario Spacagna & Daniel Slater & Peter Roelants
Python Program to Iterate Over Dictionaries Using for Loop
Python issubclass()
Python Dictionary popitem()
Python Program to Remove Duplicate Element From a List
Python String rjust()
Python Program to Find the Largest Among Three Numbers
Python String isnumeric()
Python frozenset()
Python Program to Find the Square Root
Python Program to Sort Words in Alphabetic Order
Python Set discard()