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)
![Nikolaos Karathanasis](https://secure.gravatar.com/avatar/df61201810c9ade9e1a3995e1ac98fab?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nikolaos Karathanasis
496 Points!= vs ==
I though != meant "is not". In the below logic, I wrote it down in a way like saying "if the user refuses to buy the tickets, then say "Thank you". But regardless if the answer is Y or N, it stays in the "if" loop, how come?
proceed = input("Would you like to proceed, {}? Y/N " .format(name))
if proceed.lower() != "n":
print("SOLD!")
tickets_remaining = tickets_remaining - num_tickets
else:
#say Thank them by name.
print("Thank you, {}." .format(name))
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsThe loop would be defined with a "for" or "while", neither of which are shown here.
Also, what's inside the loop is determined by indentation. For your indentation to show up you have to post your code using Markdown formatting.
![tomaszfurmanczyk](https://secure.gravatar.com/avatar/bfdd31a2ba561140de80bd5d1f225e5f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
tomaszfurmanczyk
Full Stack JavaScript Techdegree Student 18,242 PointsThis all depends on how you would like to structure the conditional statement. However, the more efficient design would be:
proceed = input("Would you like to proceed, {}? Y/N " .format(name))
if proceed.lower() == "y": print("SOLD!") tickets_remaining = tickets_remaining - int(num_tickets)
else:
print("Thank you, {}." .format(name))
Nick Evershed
6,429 PointsNick Evershed
6,429 Points!= is bang or not equal to, == is checking comparrison and = is assigning