In this python if else program, accept the temperature in Fahrenheit and check whether the water is boiling or not.
To convert temperatures in degrees Fahrenheit to Celsius, subtract 32 and multiply by .5556 (or 5/9). To convert temperatures in degrees Celsius to Fahrenheit, multiply by 1.8 (or 9/5) and add 32.
Steps to solve the program
- Take the temperature in Fahrenheit as input through the user.
- The boiling temperature of water in Fahrenheit is 212.
- Using an if-else statement check whether the input temperature is equal to 212.
- Print the respective output.
temp = int(input("Enter temperature of water in Fahrenheit: "))
if temp != 212:
print("Water is not boiling")
else:
print("Water is boiling")
Output :
Enter temperature of water in Fahrenheit: 190
Water is not boiling
Related Articles
Python program to accept marks from the user allot the stream based on the following criteria.
Python program to check given number is divided by 3 or not.
If else program to get all the numbers divided by 3 from 1 to 30.
If else program to assign grades as per total marks.
Python program to check the given number divided by 3 and 5.