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 issubclass()
Python Program to Find HCF or GCD
Python String translate()
Python Program to Remove Punctuations From a String
Python String islower()
Python for Programmers with introductory AI case studies - Paul Deitel & Harvey Deitel
Python len()
Python Program to Count the Number of Each Vowel
Python Program to Check if a Number is Positive, Negative or 0
Python frozenset()
Python String startswith()
Python print()
Python String ljust()
Python String index()
Python List sort()
Python Data Types
Python Dictionary setdefault()
Python Program to Find ASCII Value of Character
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python classmethod()
Python Program to Get the Last Element of the List
Python Program to Check the File Size
Python String encode()
Python Global, Local and Nonlocal variables
Python hash()
Python Dictionary copy()
Python Data Structures and Algorithms - Benjamin Baka
Python Set discard()
Python round()
Python vars()
Python object()