Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


srikanth soma
srikanth soma
1,572 Points

Invalid syntax error shopping list part 2

Shopping list

print("Creating a list") shopping_list = [] def help_commands(): print("Type DONE once you done adding to list") print("Type HELP for help") print("Type SHOW for list of items")

def show_list(): for items in shopping_list: print(items)

def list_added_items(): new_items = input("Enter the items in list\n >") shopping_list.append(new_items) print("{} item added in to the list. the list has {} items".format(new_items,len(shopping_list))

while True: if new_items == "DONE": break elif new_items == "SHOW": show_list() continue elif new_items == "HELP": help_commands() continue elif new_items == "ADD": list_added_items() continue

When I run the above code I get syntax error on line 18 which is while True: can someone help me understand where I'm doing wrong ?