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 List insert()
Python Deep Learning Cookbook - Indra den Bakker
Python Program to Find the Square Root
Python String isalnum()
Python pow()
Python Set intersection()
How to get current date and time in Python?
Python Program to Find the Factorial of a Number
Python Program to Merge Mails
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python List copy()
Python Program to Iterate Through Two Lists in Parallel
Python Program to Sort Words in Alphabetic Order
Python List Comprehension
Python Set remove()
Python String count()
Python tuple()
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Applied Text Analysis with Python - Benjamin Benfort & Rebecca Bibro & Tony Ojeda
Python String isnumeric()
Python List reverse()
Python open()
Python Program to Generate a Random Number
Python hex()
Python Program to Calculate the Area of a Triangle
Python max()
Python Program to Find Sum of Natural Numbers Using Recursion
Python Program to Split a List Into Evenly Sized Chunks
Python String rfind()
Python String endswith()
Python Program to Capitalize the First Character of a String