Need help with Hovercraft | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Need help with Hovercraft

I’m getting 4/5 correct and can’t figure out why. If possible please help. My code is below, in Python. Thank you. import math sales = int(input()) months = int(math.ceil(sales/10)) cost = 21*months if 3*sales > cost: print("Profit") elif 3*sales < cost: print("Loss") else: print("Broke Even")

27th Dec 2019, 9:37 PM
Anne L
Anne L - avatar
1 Answer
+ 1
Fails for 0. Output should be "Loss", not "Broke Even". Hint: Take a look at "months" value.
27th Dec 2019, 9:58 PM
Diego
Diego - avatar