Python program to convert Celsius to Fahrenheit

Created with Sketch.

Python program to convert Celsius to Fahrenheit

Celsius:

Celsius is a unit of measurement for temperature. It is also known as centigrade. It is a SI derived unit used by most of the countries worldwide.

It is named after the Swedish astronomer Anders Celsius.

Fahrenheit:

Fahrenheit is also a temperature scale. It is named on Polish-born German physicist Daniel Gabriel Fahrenheit. It uses degree Fahrenheit as a unit for temperature.

Conversion formula:

T(℉) = T(℃) x 9/5 + 32

Or,

T(℉) = T(℃) x 1.8 + 32

See this example:

  1. # Collect input from the user
  2. celsius = float(input(‘Enter temperature in Celsius: ‘))
  3. # calculate temperature in Fahrenheit
  4. fahrenheit = (celsius * 1.8) + 32
  5. print(‘%0.1f  Celsius is equal to %0.1f degree Fahrenheit’%(celsius,fahrenheit))

Output:

Python Basic Programs9

 

Leave a Reply

Your email address will not be published. Required fields are marked *