+ 1

Code Coach : Hovercraft Can someone please tell me why is this not showing correct answer?

sold = int(input()) cost = (sold * 3000000 ) if cost > 21000000: print('Loss') if cost < 21000000: print('Profit') if cost == 21000000: print('Broke Even')

14th Jul 2022, 11:09 AM
Kruti
Kruti - avatar
3 Answers
+ 3
how if cost > 21,000,000 is a loss ? Maybe you mixed up things due to confusing variable names !
14th Jul 2022, 11:20 AM
Abhay
Abhay - avatar
+ 2
The costs you have had for a hovercraft are fix as well as insurence and show in the task descroption. With these data and the number of sold pieces you can calculate all together.
14th Jul 2022, 11:27 AM
JaScript
JaScript - avatar
+ 1
Abhay ah right .. thanks!! Should've used better variable names
14th Jul 2022, 11:25 AM
Kruti
Kruti - avatar