Program 2
2. Write a Python program to convert temperature in Celsius to Fahrenheit.
In the program below, we take a temperature in degree Celsius and convert it into degree
Fahrenheit. They are related by the formula
Fahrenheit = Celsius * 1.8 + 32
Program 2:
#Python Program to convert temperature in Celsius to fahrenheit
#change this value for a different result
print("Enter Temperature in Celsius: ")
celsius = int(input())
fahrenheit = (celsius * 1.8) + 32
print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit))
OUTPUT
Enter Temperature in Celsicus:
167
167.0 degree Celsius is equal to 332.6 degree Fahrenheit
Comments
Post a Comment