Python Program to Convert Celsius To Fahrenheit

71
views
Celsius To Fahrenheit

In this program, you’ll learn how to Convert Celsius To Fahrenheit in Python.

To properly understand this how to Convert Celsius To Fahrenheit, you should have the knowledge of following Python programming topics:

  1. Python Input, Output and Import
  2. Python Variables and Data Types
  3. Python Operators

NOTE:celsius * 1.8 = fahrenheit - 32

Program to Convert Celsius to Fahrenheits

[sourcecode language=”c”]# 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))[/sourcecode]

Output:

[sourcecode language=”plain”]37.5 degree Celsius is equal to 99.5 degree Fahrenheit[/sourcecode]

The above code can be converted into Faherenite to Celsius using the following formula

celsius = (fahrenheit - 32) / 1.8

Convert Celsius To Fahrenheit in Python

  1. Program to find the area of Triangle in Python
  2. Program to Solve Quadratic Equation in Python
  3. Program to Generate a Random Number in Python
  4. Program to Generate a Random alphanumeric String in Python

Ask your questions and clarify your/others doubts on by commenting. Python Documentation