Has anyone solved "if case #5" about ice cream for 10 friends in python course? | Sololearn: Learn to code for FREE!

0

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

Can't carry out the 4th hidden case

11/3/2020 4:42:25 PM

Алексей Тимаков

9 Answers

New Answer

+13

Алексей Тимаков 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.

+2

Алексей Тимаков I'm not a pro user. Can you state the problem?

+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)

+1

It's the one for pro users. Non pro users don't know it, so please elaborate on what exactly is the question, what you need to do and what do we need to use.

+1

BeegCat , thanks a lot!

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

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.

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...

0

Use the @ symbol, and then their username to mention anyone specifically.