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 Decorators
Python Program to Display Fibonacci Sequence Using Recursion
Python Dictionary popitem()
Python String rpartition()
Python Program to Create a Long Multiline String
Python Exception Handling Using try, except and finally statement
Python String zfill()
Python input()
Python Program to Copy a File
Python setattr()
Python List
Python List insert()
Python Global, Local and Nonlocal variables
Python property()
Python Strings
Python Program to Get the Last Element of the List
Python Program to Parse a String to a Float or Int
Python Program to Capitalize the First Character of a String
Python String capitalize()
Python Operator Overloading
Python Global Keyword
Python Program to Check Prime Number
Python Modules
Python String isspace()
Python Program to Display the multiplication Table
Python break and continue
Python Program to Find the Factors of a Number
Python Tuple count()
Deep Learning in Python - LazyProgrammer
Python String ljust()
Python Program to Print Hello world!
Python Shallow Copy and Deep Copy