English

Write a Python program to convert temperature in degrees Celsius to degrees Fahrenheit. If the water boils at 100 degrees C and freezes at 0 degrees C, use the program - Computer Science (Python)

Advertisements
Advertisements

Question

Write a Python program to convert temperature in degrees Celsius to degrees Fahrenheit. If the water boils at 100 degrees C and freezes at 0 degrees C, use the program to find out what is the boiling point and freezing point of water on the Fahrenheit scale. (Hint: T(°F) = T(°C) × 9/5 + 32)

Answer in Brief
Advertisements

Solution

Program:
#defining the boiling and freezing temp in Celcius
boil = 100
freeze = 0
print('Water Boiling temperature in Fahrenheit::')
#Calculating Boiling temperature in Fahrenheit
tb = boil * (9/5) + 32
#Printing the temperature
print(tb)

print('Water Freezing temperature in Fahrenheit::')
#Calculating Boiling temperature in Fahrenheit
tf = freeze * (9/5) + 32
#Printing the temperature
print(tf)

OUTPUT:
Water Boiling temperature  in Fahrenheit::
212.0
Water Freezing temperature in Fahrenheit::
32.0
shaalaa.com
Operators - Arithmetic Operators (-,+,*,/,%)
  Is there an error in this question or solution?
Chapter 5: Getting Started with Python - Exercise [Page 117]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 5 Getting Started with Python
Exercise | Q 10. | Page 117
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×