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 Operators
Python Multiple Inheritance
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Python hash()
Python Program to Find Sum of Natural Numbers Using Recursion
Python Program to Sort Words in Alphabetic Order
Python Set symmetric_difference()
Python Program to Illustrate Different Set Operations
Python Machine Learning - Sebastian Raschka
Machine Learning with Python for everyone - Mark E.Fenner
Python Program to Find Factorial of Number Using Recursion
Python Program to Remove Duplicate Element From a List
Python Program to Make a Flattened List from Nested List
Python Machine Learning Third Edition - Sebastian Raschka & Vahid Mirjalili
Python String splitlines()
Python String encode()
Python str()
Python enumerate()
Python reversed()
Python Program to Find the Sum of Natural Numbers
Python Program to Reverse a Number
Python Set union()
Python Function Arguments
Python bool()
Python Program to Trim Whitespace From a String
Python globals()
Python Numbers, Type Conversion and Mathematics
Python String rstrip()
Python memoryview()
Python Program to Check If Two Strings are Anagram
Python Program to Access Index of a List Using for Loop
Python String rjust()