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 
   
    Scott George
19,060 PointsLast add_to_list not workinh
Here is my code snapshot https://w.trhou.se/m6d49sgdlc
I'm getting an error 
"> ban
Traceback (most recent call last):
  File "shopping_list.py", line 36, in <module>
    add_to_list()
NameError: name 'add_to_list' is not defined
"
My code seems to be exact as Craig's
What am I missing? 
Thanks, Scott
2 Answers
 
    Steven Parker
243,160 PointsBecause of the indentation level, both "add_to_list" and "show_list" are created as internal functions of "show_help", but they should be independent so they can be accessed from the main program.
And on line 19, there is a reference to "shoppping_list" (with 3 "p"s) instead of "shopping_list".
Also, the call to "add_to_list" on line 36 has no argument, but the function is defined as needing one.
 
    Scott George
19,060 PointsThanks, Steve! I just got it, it was only an indentation issue! :)
Scott George
19,060 PointsScott George
19,060 PointsThanks. I just watched the video again and re wrote my code, it seems exactly the same as the video but I'm still getting the same error. Any examples you could point me to? Thanks
Steven Parker
243,160 PointsSteven Parker
243,160 PointsYou haven't provided a new snapshot, but here's an indent example from the previous one: