Write Python code convert temperature from Fahrenheit to Celsius-
Answer-
Code-
#user enter temperature in fahrenheit
fahrenheit = float(input("Please enter temperature in fahrenheit: "))
# formula that convert temperature from Fahrenheit to Celsius
#Celsius = (Fahrenheit – 32) * 5/9
celsius = (fahrenheit - 32) * 5/9
print('Fahrenheit temperature %.2f in Celsius is : %0.2f Celsius' %(fahrenheit, celsius))
Output-
Please enter temperature in fahrenheit: 200
Fahrenheit temperature 200.00 in Celsius is : 93.33 Celsius
Comments
Post a Comment