+ 1

help! skee-ball: test code 3 failed

hi! I'm not sure what's wrong with my code (below) since test code 3 keeps failing :( points = int(input()) cost = int(input()) if (points/12) // cost >0: print ('Buy it!') else: print ('Try again') Description: You are playing a game at your local arcade, and you receive 1 ticket from the machine for every 12 points that you score. You want to purchase a squirt gun with your tickets. Given your score, and the price of the squirt gun (in tickets) are you able to buy it? Task Evaluate whether or not you have scored high enough to earn enough tickets to purchase the squirt gun at the arcade. Input Format The first input is an integer value that represents the points that you scored playing, and the second input is an integer value that represents the cost of the squirt gun (in tickets). Output Format A string that say 'Buy it!' if you will have enough tickets, or a string that says 'Try again' if you will not. Sample Input 500 40 Sample Output Buy it!

29th Mar 2021, 10:57 AM
cal
2 Answers
+ 3
points=int(input()) cost=int(input()) if points/12==cost or points/12>cost : print ("Buy it!"); else : print ("Try again");
29th Mar 2021, 11:36 AM
Atul [Inactive]
+ 2
Check the condition. You have to both check for equality as well as greater than too
29th Mar 2021, 11:37 AM
Atul [Inactive]