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 Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python hasattr()
Python Recursion
Python Program to Find the Factors of a Number
Python String maketrans()
Python ascii()
Python Program to Make a Simple Calculator
Python Global Keyword
Python Data Structures and Algorithms - Benjamin Baka
Python Objects and Classes
Python bytearray()
Python Program to Display the multiplication Table
Python Program to Find the Size (Resolution) of a Image
Python Strings
Python Program to Check If a String Is a Number (Float)
Python Program to Find ASCII Value of Character
Python Set remove()
Python staticmethod()
Python help()
Python Input, Output and Import
Python Tuple index()
Python Program to Sort a Dictionary by Value
Python Package
Python enumerate()
Python List reverse()
Python String isalnum()
Python String isidentifier()
Python Sets
Machine Learning with Python for everyone - Mark E.Fenner
Python len()
Python locals()
Python String istitle()