## 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.

# Trying to prevent the rest of the code running when the # of tickets goes to 0. Haven't had success yet, heres my code.

TICKET_PRICE = 10 tickets_remaining = 100 while tickets_remaining >=1: name = input("Hello, what is your first and last name? ") ticket_amount = int(input("{}, How many tickets would you like? ".format(name))) total_price = (ticket_amount * TICKET_PRICE) print("Hello, {}".format(name)) print("Your total ticket price is, \${} dollars".format(total_price))

```proceed = input("Would you like to proceed with the purchase, {}? \nY/N?".format(name))
proceed = proceed.lower()

while proceed != "y" and proceed != "n":
proceed = input("Sorry, please state Y or N ")

if proceed == ("n"):
print("Thank you, have a nice day, {}".format(name))

elif proceed == ("y"):
tickets_remaining = (tickets_remaining - ticket_amount)
print("Thank you for your purchase, {}!".format(name))
print("There are {} tickets remaining".format(tickets_remaining))
```

print("sorry, tickets are all sold out")

But as shown in the video, putting everything inside the `while tickets_remaining:` loop should cause it to stop when there are no tickets. If you need more explicit help, please format your code (or make a snapshot of your workspace and post the link to it) and explain what input you are providing when it runs.