- 2

Test case 4 don't work

Can't get the test 4 working?? https://www.sololearn.com/coach/127?ref=app money = int(input()) price = int(input()) all = price * 10 x = money - all if all <= 100: print(x) if Statements +10 XP 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 7*10 = 70. 10 is remaining money (80-70).

2nd Aug 2020, 10:38 AM
Kierren Haggerty
Kierren Haggerty - avatar
19 odpowiedzi
+ 1
Kierren Haggerty , please place the whole description of the task, because it is visible only by Pro users, so somebody can help you.
2nd Aug 2020, 10:56 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 3
Just check your if condition again.. It is in reverse...
2nd Aug 2020, 11:08 AM
Jayakrishna 🇮🇳
+ 3
#This will work money = int(input()) price = int(input()) #your code goes here all = price * 10 bal = money - all if all > money : print() elif all <= 100: print (bal) elif price >= 0: print(bal)
4th Oct 2020, 9:10 PM
Harsh Pareek
Harsh Pareek - avatar
+ 2
money = int(input()) price = int(input()) total = price*10 if total<=money: print(money-total)
15th Apr 2021, 1:45 PM
Rose Antonette Paez
Rose Antonette Paez - avatar
+ 1
if Statements +10 XP 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 7*10 = 70. 10 is remaining money (80-70).
2nd Aug 2020, 10:57 AM
Kierren Haggerty
Kierren Haggerty - avatar
+ 1
Thanks heaps
2nd Aug 2020, 11:10 AM
Kierren Haggerty
Kierren Haggerty - avatar
+ 1
money = int(input()) price = int(input()) total=price*10 #your code goes here remainder=money-total if (total>money): print() else: print(remainder) Despite all my attempt, I failed in test 4. Don't know how to resolve?
6th Dec 2020, 2:38 AM
Rajat Banerjee
Rajat Banerjee - avatar
+ 1
15th May 2022, 5:49 AM
Nishtha Rani
0
Kierren Haggerty , I think it should be if x >= 0: ....
2nd Aug 2020, 11:10 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
this will definitely work money = int(input()) price = int(input()) total = price*10 left = money - total if (total > money): print() else : print(left) my all test cases passed
29th Nov 2020, 8:08 AM
Krishna Sarawagi
Krishna Sarawagi - avatar
0
you need to do the print() to return nothing. if you simply skip if its bigger than 100, it’ll pass that test but fail test4
30th Nov 2020, 1:44 AM
Ken
Ken - avatar
0
I think this is the shortest solution, money = int(input()) price = int(input()) total = price*10 if money >= total: print(money % total)
22nd Feb 2021, 7:15 PM
Everything News
Everything News - avatar
0
Money= int(input()) Price=int(input()) Total= price*10 remaining_money= money - total If total <= money : Print ( x)
10th Apr 2021, 6:00 AM
tufail ahmed
tufail ahmed - avatar
0
a = money = int(input()) b = price = int(input()) c = total_price = b * 10 d = balance = a - c e = a//b if c <= 100: print(d) elif e >= 10: print(balance) else: print() it will defenently work try it once
10th Jun 2021, 12:37 PM
Sureshbabu D
Sureshbabu D - avatar
0
money = int(input()) price = int(input()) total=0 total = price*10 total=money-total if total >= price: print(total) elif total>=0: print(total) else: print()
20th Jul 2021, 12:04 AM
Peyman Daei Rezaei
Peyman Daei Rezaei - avatar
0
money = int(input()) price = int(input()) total = price*10 if money / price >= 10: print(money % total)
19th Aug 2021, 1:57 PM
Justen Roldan
0
It's not that complicated but the problem was not properly explained. The program is meant to print the difference of the money you have vs the cost of the ice-cream IF you can afford the ice cream. e.g. if money >= total: print(money - total)
23rd Jan 2022, 7:48 AM
Shioke
- 1
“”” this worked for me “”” a = money = int(input()) b = price = int(input()) c = total_price = b * 10 d = balance = a - c e = a//b if c <= 100: print(d) elif e >= 10: print(balance) else: print()
21st Oct 2020, 5:26 PM
Micheal Olan
Micheal Olan - avatar
- 4
Bunty and Biscuits Problem Statement: Bunty the dog wants to buy Biscuits from the Parle canteen and Britannia canteen. Buying X biscuits from Parle canteen will cost him A"(X"X) rupees and Buying X biscuits from Britannia will cost him B"(X"X) rupees. Please help Bunty to buy exactly N biscuits and minimize the money he pays
10th Apr 2022, 5:47 AM
IMRAN GAZI
IMRAN GAZI - avatar