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 trialMit Sengupta
13,823 PointsI am asked to move everything into the main function. So I did. show_help() # make a list to hold ont
But it isn't passing.
Here's my code:
def main():
show_help()
# make a list to hold onto our items
shopping_list = []
while True:
# ask for new items
new_item = input("> ")
# be able to quit the app
if new_item == 'DONE':
break
elif new_item == 'HELP':
show_help()
continue
elif new_item == 'SHOW':
show_list(shopping_list)
continue
add_to_list(shopping_list, new_item)
show_list(shopping_list)
2 Answers
Ken Alger
Treehouse TeacherMit;
Double check your indentation in your main()
method. If your indentation is correct throughout the entire method it will pass the challenge.
Happy coding,
Ken
james white
78,399 PointsThis comment was not as helpful as the answer in this thread:
https://teamtreehouse.com/community/trouble-with-main-function
Ken Alger
Treehouse TeacherI appreciate your thoughts, but I tend to point people in a direction which will allow them to come to proper solutions on their own accord instead of giving away answers to the challenges. I find that it helps people learn more. Perhaps we have a different though process on the method of learning and assisting others in the process.
If you look over many of the responses I have provided here in the forums, if my initial response does not lead to an answer I continue to assist until an answer is found.
Thanks for all you do.
Ken
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherEdited for markdown