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

Python Python Basics (Retired) Shopping List Shopping List Project

I used the same code and when it asks to add i enter it and it does not say Added and when i type DONE nothing happen.

shopping_list = list()

print("What should we get at the store today?") print("Enter 'DONE' to stop adding items.")

while True: new_item = input("> ")

if new_item == 'DONE': break

shopping_list.append(new_item)
print("Added! List has {} items.".format(len(shopping_list)))
continue

print("Here is your list: ")

for item in shopping_list: print(item)

I used that code and for some reason it does not work..

3 Answers

John Hill
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
John Hill
Front End Web Development Techdegree Graduate 35,236 Points

Hey there, looks like you need to use brackets instead of parenthesis for shopping_list.

So… shopping_list = list[]

Also, the indentation may be off. If you can post the whole code as its currently formatted, I could check it for you.

I seemed to figure it out, The brackets seemed to help. Thanks!