0

Hovercraft help

The result of Hovercraft Test keeps showing error : missing colon in if statement. sold = int (input()) earned = sold * 3 000 000 if earned > 21 000 000: print ("Profit") if earned < 21 000 000: print ("Loss") else: print ("Broke Even")

19th Nov 2022, 10:37 PM
Vava
Vava - avatar
3 odpowiedzi
+ 4
The 3 possible outcomes are mutually exclusive. Change your second 'if' to 'elif'.
20th Nov 2022, 7:51 AM
Tibor Santa
Tibor Santa - avatar
+ 2
You must write the numbers without whitespace inside. 3000000 instead of 3 000 000
20th Nov 2022, 6:01 AM
Tibor Santa
Tibor Santa - avatar
0
Now when input 10, my output: 'Profit' and 'Broke Even'. Expected output: 'Profit'.
20th Nov 2022, 7:16 AM
Vava
Vava - avatar