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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![David Mikeska](https://secure.gravatar.com/avatar/d252ddb75291b3a2546d05ff529e51f1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
David Mikeska
17,536 PointsHaving issues adding more than one item to the list and having problems exiting application by typing DONE.
# Create a list
shopping_list = []
# Create a function that adds an item to the list.
def add_list(item):
shopping_list.append(item)
#Let user know the item has been added and state the number of items in the list.
print("Added: Item has just been added {}".format(len(shopping_list)))
def show_help():
print("What should we pickup at the store??")
print("""
Enter 'DONE' when you are finished.
Enter 'HELP' when you need help
""")
show_help()
while True:
new_item = input("> ")
if new_item == 'DONE':
break
elif new_item == 'HELP':
show_help()
continue
#Call function that adds item to the list
add_list(new_item)
formatted by staff
1 Answer
![Megan Amendola](https://uploads.teamtreehouse.com/production/profile-photos/7340382/micro_headshot.jpg)
Megan Amendola
Treehouse TeacherHi! You need to move the add_list()
call inside of your while loop
while True:
new_item = input("> ")
if new_item == 'DONE':
break
elif new_item == 'HELP':
show_help()
# you don't need this its a loop so it will continue anyways-> continue
else:
#Call function that adds item to the list
add_list(new_item)
David Mikeska
17,536 PointsDavid Mikeska
17,536 PointsAhh. Thanks. Very helpful!