0

# Ice Cream for Everyone isn't working?

I can't seem to get my code for this practice question to work: 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. code: money = int(input()) price = int(input()) total = price*10 if money >= total Print() if money <= total print(money - total)

15th Feb 2021, 8:47 PM
Alita Tripp
0
What's total here ?
15th Feb 2021, 9:07 PM
Hima
0
15th Feb 2021, 9:15 PM
**đŠđȘ|đŠđȘ**
0
Updated
15th Feb 2021, 11:20 PM
Alita Tripp
0
If you have enough money to buy the ice cream, you would buy it but in the code you are not .
15th Feb 2021, 11:29 PM
Hima
0
#Ice Cream for Everyone isn't working? #I can't seem to get my code for this practice question to work: #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. #code: #money = int(input()) #price = int(input()) #total = price*10 #if money >= total # Print() #if money <= total # print(money - total) money =int(80) price=int(7) total = price *10 print (total ,money -total) Can we try this
16th Feb 2021, 6:13 PM
Irfan Shaikh