0

Sleep-ball

My code is successful 4/5 times for the Skee-ball challenge using Python. Besides it being super basic, I’m not sure what’s wrong with it... Thanks for the help! score = int(input()) ticketPrice = int(input()) tickets = int(score/12) if tickets > ticketPrice: print("Buy it!") else: print("Try again")

13th Jun 2020, 10:15 PM
Brent Larke
Brent Larke - avatar
5 Respuestas
+ 4
Try it the other way round or with a greater-equal 😉
13th Jun 2020, 10:23 PM
Sandra Meyer
Sandra Meyer - avatar
+ 2
Brent Larke That type of error is so common it deserves a wikipedia article: https://en.wikipedia.org/wiki/Off-by-one_error So don't worry, it happens to the best of us (all the time).
13th Jun 2020, 11:47 PM
Schindlabua
Schindlabua - avatar
+ 1
ah yes i see :( so basic. maybe im not cut out for this. thank you very much
13th Jun 2020, 10:26 PM
Brent Larke
Brent Larke - avatar
0
You're welcome
13th Jun 2020, 10:28 PM
Sandra Meyer
Sandra Meyer - avatar
0
x=int(input()) y=int(input()) if ((x/12)>=y): print("Buy it!") else: print("Try again") It's simple and easy try copy pasting in exact same way.
31st May 2022, 11:28 AM
Hrithika Reddy
Hrithika Reddy - avatar