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))
7 ответов
+ 5
Somil Khandelwal ,
have look on the way you calculate the points. please read the task description carefully!
+ 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 '>'
...
+ 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.
+ 1
Also remember that you only need as many points as the gun costs. You don't need more.
0
Lothar i still don't understand thus task
0
cost of gun equal to the number of tickets right?
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