+ 1

# Help me to solve this ice cream sum I am not able to solve the test case#2

m=int(input()) p=int(input()) balance=m-(p*10) if balance>=0: print(balance)

31st Dec 2020, 7:07 AM
Ravikumar
+ 4
I dont know much about the details of the challenge so I will assume that the output is the money needed to buy the 10 items rather than the change. However, this is just a possibility, please update me if the problem is still not solved. https://code.sololearn.com/ca3A24A7A13a
31st Dec 2020, 7:23 AM
noteve
+ 3
What are the details of the challenge? What are the sample inputs and outputs? I cant seem to find the challenge. Thanks!
31st Dec 2020, 7:12 AM
noteve
+ 3
What do you mean? You mean it does not satisfy other test cases? Can you send the challenge details like the task or description. I've solved the chalenge in the past but I cant completely remember it. Thanks!
31st Dec 2020, 10:36 AM
noteve
+ 3
What if you cant buy the ice cream? "No output." ? # I just changed the variables but this is the same to your first one. money = int(input()) price = int(input()) if money > price*10: print(money - price*10) #I think your first solution is right based on the problem but #This sample is contradicting hmm... M=151 P=13 Expected output=0 My output=21
31st Dec 2020, 11:30 AM
noteve
+ 2
Ravikumar Bro, I now know the problem. It says in the challenge if the total price of ice cream is greater than 100, do not output anything. So the code should be like this: m=int(input()) p=int(input()) balance=m-(p*10) if p <= 100: print(balance)
7th Jan 2021, 1:04 PM
noteve
+ 1
M=151 P=13 Expected output=0 My output=21
31st Dec 2020, 7:13 AM
Ravikumar
+ 1
Tq dude
31st Dec 2020, 7:40 AM
Ravikumar
+ 1
No it is not solved it doesn't satisfied other condition
31st Dec 2020, 8:05 AM
Ravikumar
+ 1
Let's imagine you want to buy an ice-cream for 10 of your friends. Write a program that will take the money you have and the price of one ice-cream, and will output the remaining money only if you can buy that ice-cream for your all 10 friends. Sample Input 80 7 Sample Output 10 Explanation To buy 10 ice-creams you need 7*10 = 70. The remaining money is 80-70 = 10.
31st Dec 2020, 11:15 AM
Ravikumar
+ 1
Yes that's the problem
31st Dec 2020, 12:22 PM
Ravikumar