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

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 ?