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:
Introduction to Scientific Programming with Python - Joakim Sundnes
Python Program to Convert Two Lists Into a Dictionary
Python datetime
Python Program to Find ASCII Value of Character
Python Dictionary get()
Python eval()
Python Program to Get the Last Element of the List
Python String capitalize()
Python Program to Swap Two Variables
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Python Program to Check the File Size
Python Program to Count the Occurrence of an Item in a List
Python Program to Find LCM
Deep Learning with Python - A Hands-on Introduction - Nikhil Ketkar
Python Set discard()
Python reversed()
Python Program to Shuffle Deck of Cards
Python Program to Get File Creation and Modification Date
Python all()
APIs in Node.js vs Python - A Comparison
Deep Learning in Python - LazyProgrammer
Python Program to Find All File with .txt Extension Present Inside a Directory
Python frozenset()
Python Recursion
Python oct()
Python Program to Display Powers of 2 Using Anonymous Function
Python Namespace and Scope
Python Iterators
Python Dictionary clear()
Python Program to Add Two Matrices
Python Errors and Built-in Exceptions
Python Package