+ 1

If statements

I can’t get test case 5 I have the other 4 what is wrong with my code?

8th Jul 2022, 9:26 PM
J91
4 Antworten
+ 1
You can check in playground.. For input 100 , you code outputs all 3 options " Boiling" No", "true ". Input less than 100 will output nothing. Because your 2 if is in 1st if, and 3rd if is in 2nd if. Not properly idented. Put all 3 if blocks with same identation. And temp = 100 will already convering by <= and >=. If you want to separate it then use >, < instead of <= , >= .. Hope it helps to correct mistakes..
8th Jul 2022, 9:39 PM
Jayakrishna 🇮🇳
+ 1
temp = int(input()) if temp >= 100: print("Boiling") if temp <= 100: print("no") if temp == 100: print("true")
8th Jul 2022, 9:26 PM
J91
+ 1
Thank you!
8th Jul 2022, 9:55 PM
J91
+ 1
I just used else statements instead
8th Jul 2022, 9:55 PM
J91