What's the problem with my code for the Hovercraft challenge? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

What's the problem with my code for the Hovercraft challenge?

sale_for_one = 3,000,000 sales = int(input()) profit = sales * sale_for_one loss = 21,000,000 if profit > loss: print('Profit') elif profit == loss: print('Broke Even') elif loss > profit: print('Loss')

11th Apr 2023, 8:30 AM
ori cohem
ori cohem - avatar
4 Antworten
+ 5
ori cohem Don't put commas in integer value as you wrote on paper. Otherwise it will become 3 values, instead of single value.
11th Apr 2023, 8:50 AM
Jayakrishna 🇮🇳
+ 4
For the convenience of writing large numbers, you can use only the lower underscore: sale_for_one = 3_000_000
11th Apr 2023, 9:35 AM
Solo
Solo - avatar
+ 3
Thanks!
11th Apr 2023, 10:10 AM
ori cohem
ori cohem - avatar
11th Apr 2023, 8:40 AM
Yasin Rahnaward
Yasin Rahnaward - avatar