+ 8

what's wrong with this "Hovercraft" code?

sell = int(input()) if sell <= 0 or sell == 7: print("Broke Even") if sell < 7 and sell > 0: print("Loss") if sell > 7 and sell < 11: print("Profit")

3rd Feb 2022, 5:53 PM
yonas
yonas - avatar
3 Antworten
+ 8
I get it!!! My mistake sell = int(input()) if sell < 7: print("Loss") elif sell > 7: print("Profit") else: print("Broke Even")
11th Feb 2022, 3:34 PM
yonas
yonas - avatar
+ 3
Read the conditions again... it need not be less than 11 or greater than 0 to test.
3rd Feb 2022, 6:02 PM
Jayakrishna 🇮🇳
+ 1
I don't see any error in your code. Your code works fine I think you might have got some failed test cases
3rd Feb 2022, 6:03 PM
hamishhr
hamishhr - avatar