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 trialDavid Burks
731 Pointsfile 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):
shopping_list.append(item)
print("Added: List has {} items.".format(len(shopping_list)))
show_list()
while True:
new_item = input(">")
if new_item == 'DONE'
break
elif new_item == 'HELP':
show_help()
continue
add_to_list(new_item)
continue
show_list()
I really hope this shows correctly.
David Burks
731 Pointswell, 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
Treehouse Guest TeacherSo 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.
David Burks
731 Pointsthanks, 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
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 Pointswhat's the error message? and what's your code?