If statements V | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

If statements V

Im not passing my 2nd test case. Its subtracting the the money variable from the total price but the output comes back as negative. Im not sure what is causing this issue. Help please Im stuck money = int(input()) price = int(input()) total = price*10 #your code goes here if money >= total: left_over = int(total) - money print(left_over) else: print("")

5th Feb 2022, 6:56 PM
Angel Chaple
Angel Chaple - avatar
2 Answers
0
I think it should be money-total instead of total-money
5th Feb 2022, 7:03 PM
Simon Sauter
Simon Sauter - avatar
0
Thank you so much. I hadnt even realized I had it backwards. Thank you!!!
5th Feb 2022, 7:32 PM
Angel Chaple
Angel Chaple - avatar