Python Python Basics (2015) Shopping List App Continue

TJ Feledy
TJ Feledy
Pro Student 687 Points

I am unsure of what I am doing wrong in Challenge Task 1 of

This is the task where i need to skip the item with an 'a'. It saying that it didnt find the right items printed.
def loopy(items):
    # Code goes here

    for stuff in items:

        if stuff[0] == 'a':

1 Answer

Jeffrey James
Jeffrey James
2,635 Points

One way to approach it using "if not". Try to think of a way to do it without the "if not" however :)

In [5]: stuff = ['dogs', 'airplanes', 'boats']

In [6]: for x in stuff:
   ...:     if not x[0] == 'a':
   ...:         print(x)