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
chuck kotulka
4,583 PointsPython Branch and loop final project
HI,
I am having a problem with my while statement it is not printing out the number of remaking tickets. Also I my while statement printing out the number of remaining tickets. One other small issue, the Y/N confirmation code will only print in uppercase. It will not work if .lower is attached to it. I found out it is an indentation error, where do I indent my code?
please see attached screenshot.
thanks
1 Answer
Steven Parker
243,266 PointsLines that are not inside of a class, function, method, conditional, or loop should not be indented. So your first few lines (up to and including the "while") should all be against the left edge. Also, while Python allows indentation with spaces or tabs, only one style should be used in any particular file.
Then, to invoke the "lower" method, you must put parentheses after the name. And for any string to match with something that has been lowered, it must be lower case itself:
if confirm == "Y": # original code
if confirm.lower() == "y": # case-insensitive version