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 Multiple Inheritance
Python Program to Check If a String Is a Number (Float)
Python String split()
Python Program to Convert Decimal to Binary, Octal and Hexadecimal
Python Operators
Python Program to Measure the Elapsed Time in Python
Python Deep Learning - Valentino Zocca & Gianmario Spacagna & Daniel Slater & Peter Roelants
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python all()
Python Program to Merge Mails
Python Matrices and NumPy Arrays
Python reversed()
Python strptime()
Python Dictionary items()
Python filter()
Python String isalpha()
Python String format_map()
Intelligent Projects Using Python - Santanu Pattanayak
Python Program Read a File Line by Line Into a List
Python Data Analytics with Pandas, NumPy and Matplotlib - Fabio Nelli
Python Custom Exceptions
Python help()
Python String isidentifier()
Python Program to Find LCM
Python Set intersection_update()
Python Deep Learning Cookbook - Indra den Bakker
Python @property decorator
Python dir()
Deep Learning with Python - Francois Cholletf
Python Program to Create a Long Multiline String
Python String format()
Python List count()