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!

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

Python Python Basics (Retired) Putting the "Fun" Back in "Function" Shopping List Redux

file function_list.py and for some reason, I keep getting a warning telling me that function_list.py is not defined.

i can't check if my code is right because it never runs due to this error message. But then I get error messages at every turn. Here's the code.

shopping_list = ()

def show_help():
  print("What should we pick up at the store?")

 print("Enter DONE to stop. Enter HELP for this help.")

def add_to_list(item):


   print("Added: List has {} items.".format(len(shopping_list)))


while True:

  new_item = input(">")

  if new_item == 'DONE'
  elif new_item == 'HELP':


I really hope this shows correctly.

William Li
William Li
Courses Plus Student 26,868 Points

what's the error message? and what's your code?

well, that's the issue. I can't get it to run, because when I try to run the script, I keep getting the syntax error or it says, "function_list.py is not defined." . so after I type in the script name to run it, I get the error message. This is really getting disheartening. Seems like everyday I'm writing a help question.

2 Answers

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

So you've put all of that code into function_list.py? When you try to run it, do you see >>> on the left side? If so, you're still in a Python shell and need to exit() out of it.

You have some indentation problems all over that code, btw. Make sure things are indented consistently.

thanks, Kenneth. I was in the python shell. my indentations were right, putting it on here is where the wheels fell off. Thanks for the help