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)
6 odpowiedzi
0
What's total here ?
0
your code is unclear
write your inputs
0
Updated
0
If you have enough money to buy the ice cream, you would buy it but in the code you are not .
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