Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Albert Vathapally](https://secure.gravatar.com/avatar/f6d640348bd368dbec0eaab083df37d7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Albert Vathapally
575 Pointscan someone tell me whats wrong with my code?
when i run this in the console, i keep getting the letter y under the question "would you like to proceed", i answer the question with y but im not sure why i get this letter below my code. *(below is my code)
price = 10
tickets_remaining = 100
print("There are {} tickets remaining.".format(tickets_remaining)) name = input("What is your name? ")
print("Hi {},".format(name)) number_tickets = int(input("How many tickets would you like? "))
cost = int(number_tickets * price) print("This is the cost of the tickets,",cost)
var_1 = print(input("Would you like to proceed?"))
if var_1 == "y": print("Sold tickets!!") tickets_remaining -= number_tickets
else: print("Thank you! {}".format(name))
2 Answers
![Sean M](https://secure.gravatar.com/avatar/950cda97fccb24717ba01c39ee8ac75f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Sean M
7,344 Pointsjust use:
var_1 = input("Would you like to proceed?")
![KRIS NIKOLAISEN](https://secure.gravatar.com/avatar/65d74a723997b41a80d2d909c6e06960?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
KRIS NIKOLAISEN
54,969 PointsWhat you are seeing is due to this line
var_1 = print(input("Would you like to proceed?"))
Because you are using both input and print, whatever the user enters is then displayed to the screen. The print function returns None which is assigned to var_1. Since this will never equal 'y' the else statement always executes. So eliminate the print function.