- 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).
19 Antworten
+ 1
Kierren Haggerty , please place the whole description of the task, because it is visible only by Pro users, so somebody can help you.
+ 3
Just check your if condition again.. It is in reverse...
+ 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)
+ 2
money = int(input())
price = int(input())
total = price*10
if total<=money:
print(money-total)
+ 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).
+ 1
Thanks heaps
+ 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?
+ 1
0
Kierren Haggerty , I think it should be if x >= 0:
....
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
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
0
I think this is the shortest solution,
money = int(input())
price = int(input())
total = price*10
if money >= total:
print(money % total)
0
Money= int(input())
Price=int(input())
Total= price*10
remaining_money= money - total
If total <= money :
Print ( x)
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
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()
0
money = int(input())
price = int(input())
total = price*10
if money / price >= 10:
print(money % total)
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)
- 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()
- 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