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

Nathan English
Front End Web Development Techdegree Student 10,817 PointsMy if statement is not working as intended
My entire if statement line won't run when I enter "y" into the console.
TICKET_PRICE = 10
tickets_remaining = 100
while tickets_remaining :
print("There are {} tickets remaining".format(tickets_remaining))
name = input("What is your name? ")
number_of_tickets = input("Hi {}, how many tickets do you want to buy? ".format(name))
number_of_tickets = int(number_of_tickets)
total = number_of_tickets * TICKET_PRICE
print("Your total due is ${}!!".format(total))
Comfirmation = input("Do you want to proceed? Y/N ")
if Comfirmation.lower == "y":
print("Sold!!")
tickets_remaining -= number_of_tickets
else:
print("Thank you anyways {}".format(name))
print("Sorry :(, we are all out of tickets!!")
3 Answers

Nathan English
Front End Web Development Techdegree Student 10,817 Pointsops I changed this "confirmation.lower()"

Jimmy Ma
5,796 PointsStill need my help?

Nathan English
Front End Web Development Techdegree Student 10,817 PointsAll good now

Steven Parker
234,543 Points Hi, I got your requst, but it looks like you resolved your issue in the meantime.
Congratulations, and happy coding!