Welcome to the Treehouse Community
Looking to learn something new?
Martin BornmanCourses Plus Student 12,662 Points
shopping_list,Again what is wrong with my code?
What am I doing wrong?
def loopy(items): # Code goes here for items in loopy: print(items) if item == "STOP": break
You're trying to iterate over 'loopy', which is your function name, using your 'items' argument.
Here's how it should look:
def loopy(items): # Code goes here for item in items: #'item' could be anything, but traditionally people use singular form of plural argument name. print(item) if item == "STOP": break
This will print each item in the items argument until it finds one called 'STOP', and then it will stop execution.