Python Python Basics (2015) Shopping List App Continue

Can any one please assist, i'm close but not close enough. Thanks.

Any one please.
def loopy(items):
    items = []
    for loo in items:
        if loo[0]=="a":
    print (loo)
        # Code goes here

1 Answer

Stuart Wright
Stuart Wright
41,074 Points

There are three things to fix here:

  • you need to delete your "items = []" line. This has the effect of setting items equal to an empty list, rather than the list which will be passed in to the function.
  • you need to remove the space between print and (loo).
  • the same line - print(loo) - needs to be indented further so that it is inside the for loop.

Thank you so much Stuart, great to have you as a colleague.