Ad Code

Responsive Advertisement

Python Program to convert Celsius to Fahrenheit using Formula F = C * 9 / 5 + 32

Python Program to Convert  Celsius to Fahrenheit using Formula F = C * 9 / 5 + 32

Today we will learn how we can convert the Celsius into the Fahrenheit with Python.

# Celsius to Fahrenheit


cels = float ( input (  " Enter the temp in Celsius : " )
print = ( " Temperature in Celsius is : " , cels )
f = cels * 9 / 5 + 32
print ( " Temperature in Fahrenheit : ", f )

cels float input (  " Enter the temp in Celsius : " )print = ( " Temperature in Celsius is : " , cels )f = cels * 9 / 5 + 32print " Temperature in Fahrenheit : ", f )


How this Program works-:


  • First cels take the value in Celsius.

  • Then it print the temperature in Celsius.

  • Then f will calculate the Fahrenheit value. ( cels will be multiplied with the 9/5 and then adds with 32 ).

  • Then it will print the Temperature in Fahrenheit

 CODE_:


cels = float ( input (  " Enter the temp in Celsius : " )
print = ( " Temperature in Celsius is : " , cels )
f = cels * 9 / 5 + 32
print ( " Temperature in Fahrenheit : ", f )

Output-:


 Enter the temp in Celsius : 40
 Temperature in Celsius is :  40.0
 Temperature in Fahrenheit :  104.0


:::  Comment below for Query :::




Post a Comment

0 Comments