0

Has anyone solved "if case #5" about ice cream for 10 friends in python course?

Can't carry out the 4th hidden case

3rd Nov 2020, 4:42 PM
Алексей Тимаков
Алексей Тимаков - avatar
7 odpowiedzi
+ 14
Алексей Тимаков their might be some wording problem which added some confusion. As of your code if you update it with changing last if statement to only money = int(input()) price = int(input()) total = price*10 #your code goes here if money >=0 and price>=0: remaind = money - total if remaind<=100 and remaind>=0: print (remaind) Than the problem should be fixed.
3rd Nov 2020, 7:52 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
Алексей Тимаков I'm not a pro user. Can you state the problem?
3rd Nov 2020, 5:23 PM
C K
C K - avatar
+ 1
money = int(input()) price = int(input()) total = price*10 #your code goes here if money >=0 and price>=0: remaind = money - total if total <=100 and remaind >=0: print (remaind)
3rd Nov 2020, 4:44 PM
Алексей Тимаков
Алексей Тимаков - avatar
+ 1
BeegCat , thanks a lot!
4th Nov 2020, 6:49 AM
Алексей Тимаков
Алексей Тимаков - avatar
0
I've tried so many times and so many variants but it still doesn't work. Red a lot of threads about this issue, but the problem hasn't gone
3rd Nov 2020, 4:47 PM
Алексей Тимаков
Алексей Тимаков - avatar
0
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. And don't output anything if total price is over 100. That's the whole task.
4th Nov 2020, 1:28 AM
Алексей Тимаков
Алексей Тимаков - avatar
0
Gawen Steasy, I've tried as you offered me and it works! But I think there's a mistake in the text of the task (about not to output anything if total price is over 100). P.s. how to answer to someone in this chat - can't find this function...
4th Nov 2020, 1:41 AM
Алексей Тимаков
Алексей Тимаков - avatar