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 Add Two Matrices
Python Program to Randomly Select an Element From the List
Python Program to Sort a Dictionary by Value
Python Program to Print Colored Text to the Terminal
Python List index()
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Program to Convert Decimal to Binary Using Recursion
Python List sort()
Python Program to Swap Two Variables
Python Keywords and Identifiers
Python Program to Get the Full Path of the Current Working Directory
Python Program to Concatenate Two Lists
Python Program to Get File Creation and Modification Date
Python Machine Learning Eqution Reference - Sebastian Raschka
Python Program to Count the Number of Each Vowel
Python Program to Find Hash of File
Python Program to Solve Quadratic Equation
Python filter()
Python Program to Find Factorial of Number Using Recursion
Python Program to Find HCF or GCD
Python Program to Check If a List is Empty
Python Program to Extract Extension From the File Name
Python String translate()
Python dict()
Python slice()
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python String istitle()
Python Global Keyword
Python frozenset()
Python Program to Convert Two Lists Into a Dictionary
Python help()
Python Program to Delete an Element From a Dictionary