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 Count the Number of Digits Present In a Number
Python Set remove()
Python Program to Get the Full Path of the Current Working Directory
Python Program to Find the Factors of a Number
Python Program to Trim Whitespace From a String
Python Program to Count the Number of Each Vowel
Python List reverse()
Python len()
Python Deeper Insights into Machine Learning - Sebastian Raschka & David Julian & John Hearty
Python Data Types
Python Numbers, Type Conversion and Mathematics
Python Program to Check if a Number is Positive, Negative or 0
Python Keywords and Identifiers
Python classmethod()
Python Tuple
Python Program to Convert Kilometers to Miles
Python pass statement
Python pow()
Python Program to Display the multiplication Table
Python String rindex()
Python Operators
Python Program to Parse a String to a Float or Int
Python String isupper()
Python Program to Print Output Without a Newline
Python Program to Transpose a Matrix
Python Program to Represent enum
Python Namespace and Scope
Python List Comprehension
Python help()
Python all()
Deep Learning with Python - Francois Chollet
Python strptime()