Python, hidden test doesn't work | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Python, hidden test doesn't work

Write a program, which will take your money and price of one ice cream and print your left money only if you can buy ice cream for your 10 friends Don't print anything if money >100 My attempt: money = int(input()) price = int(input()) if money <=100 and money > 0: if price > 0: if money - (10*price) >= 0: print(money - (10*price))

3rd Nov 2020, 1:37 PM
ŠœŠøшŠ° Š›Š¾Š²Ń‡ŠøцŠŗŠøŠ¹
1 Resposta
+ 1
I had problems with this too and, if I remember rightly, it was because the problem was very poorly explained. The line ā€œDonā€™t print anything if money > 100ā€ should read ā€œDonā€™t print anything if the remainder is > 100ā€. Try amending your code to satisfy this condition instead.
3rd Nov 2020, 2:33 PM
Russ
Russ - avatar