0

what's wrong with this code 'Skee ball' from code coach

tickets=int(input("")) cost=int(input('')) points=tickets*12 def squirt_gun(points,cost): if points>cost: return "Buy it!" else: return "Try again" print(squirt_gun(points,cost))

3rd Jul 2021, 5:43 PM
Somil Khandelwal
7 ответов
+ 5
Somil Khandelwal , have look on the way you calculate the points. please read the task description carefully!
3rd Jul 2021, 6:58 PM
Lothar
Lothar - avatar
+ 3
Somil Khandelwal , here is a part of your code with some comments and ajustments: ... tickets=int(input("")) # 500 in SCORES = points , this is according the task description. cost=int(input('')) # 60 in TICKETS points = tickets//12 # adjusted code #points = tickets*12 # your code - it us not correct to multiply input by 12, as input is already scores == points def squirt_gun(points,cost): if points > cost: # you should better use '>=' instead of '>' ...
4th Jul 2021, 9:20 AM
Lothar
Lothar - avatar
+ 2
And two recommendations for the future: 1. You should put your code in the code playground and post a link here. That way people can run your code to see what is going on. 2. People here don't know all tasks by heart. So you should post the task description in the question. If you follow those you'll get more and better answers.
3rd Jul 2021, 9:25 PM
Simon Sauter
Simon Sauter - avatar
+ 1
Also remember that you only need as many points as the gun costs. You don't need more.
3rd Jul 2021, 9:21 PM
Simon Sauter
Simon Sauter - avatar
0
Lothar i still don't understand thus task
4th Jul 2021, 7:07 AM
Somil Khandelwal
0
cost of gun equal to the number of tickets right?
4th Jul 2021, 7:08 AM
Somil Khandelwal
0
what's wrong with this code 'Skee ball' from code coach tickets=int(input("")) cost=int(input(''))#must close the double quotes in the input I think try this may your code works points=tickets*12 def squirt_gun(points,cost): if points>cost: return "Buy it!" else: return "Try again" print(squirt_gun(points,cost)) Or try this out maybe you get some idea https://youtu.be/R4iZdPHxB30
5th Jul 2021, 3:32 AM
Sumit Kumar
Sumit Kumar - avatar