English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
In this program, you will learn to convert Celsius to Fahrenheit and display it.
To understand this example, you should understand the followingPython programmingTopic:
In the following program, we convert temperature from Celsius to Fahrenheit. They are associated with the following formula:
celsius * 1.8 = fahrenheit - 32
# Python program converts Celsius temperature to Fahrenheit temperature # Change this value to get different results celsius = 37.5 # Calculate Fahrenheit temperature fahrenheit = (celsius * 1.8) + 32 print('%0.1f Celsius equals %0.1f Fahrenheit' %(celsius,fahrenheit))
Output result
37.5 Celsius equals 99.5 Fahrenheit
We recommend that you use the following formula to create a Python program to convert Fahrenheit temperature to Celsius temperature yourself
celsius = (fahrenheit - 32) / 1.8