money = int(input()) price = int(input()) total = price*10 print(money%total) | Sololearn: Learn to code for FREE!

+1

money = int(input()) price = int(input()) total = price*10 print(money%total)

I need to get all test cases and the 3rd case has an output of no output...so how do I work an if-else or elif statement to work both success of Case tests 1, 2, 4, 5 and Test case 3? What am missing?

1/25/2021 5:34:50 PM

Ruthless SmAk

4 Answers

New Answer

+3

1. The question asks you do not print anything if you do not have enough money. Currently you always print. 2. Even though it may work with given test cases, but the money % total expression is not correct. You are not dividing your money by the total amount. If say you have 100 and the total price is 50, your expression would mean 0 left, which is not correct.

+2

Ok so when I was putting in my if and else statements I wasn't putting in a colon and was getting an error. Now I got it lol thank you!

+2

No idea what test cases you're talking about. Is this a code coach challenge?

+1

Sonic I just got it bro! So proud of myself cuz low key...this sh*&$ be hard!😂 my code was: money = int(input()) price = int(input()) total = price*10 if money<total: print() else: print(money%total) Thank you all for your help!!!🥰🤙🙏✌🥳🥳🥳