Is the water boiling?
Write a Python program that reads a temperature in Fahrenheit and says whether water is boiling (212 °F or more).
190
Enter temperature in F: 190 Water is not boiling (22 degrees to go)
Approach
- Compare with 212.
Solution
temp = float(input("Enter temperature in F: "))if temp >= 212: print("Water is boiling")else: print(f"Water is not boiling ({212 - temp:.0f} degrees to go)")Enter temperature in F: 190 Water is not boiling (22 degrees to go)
Line by line
212 °F is the boiling point at sea level.
Learn the concept
New to this topic? Read the lesson, then come back.