Python Python Basics (2015) Shopping List App Continue

Nicholas LaChance
Nicholas LaChance
2,847 Points

Didn't find the right items being printed.

I do not understand what it is I am doing incorrectly. I thought it was my indentation with the """print(items)""" but I don't believe that is the issue. I also have tried not including the """for""" loop and just """if and else""" statements. I feel completely out options. I am sorry if my question is unclear, I am still a beginner. I just would like to either understand what the question is asking more clearly or a different way I could approach this that I wasn't thinking about.

PS: This is my first question, I again apologize if my question is not clear.
def loopy(items):
    for item in items:
        if [0] in items == "a":

1 Answer

Jeffrey James
Jeffrey James
2,635 Points

try this in your console. Note how the logic works in conjunction with the continue piece.

>>> def some_func(some_iterable):
...   for i in some_iterable:
...     if i[0] is 'a':
...       print('******* The first letter of {} is A'.format(i))
...     else:
...       continue
>>> some_func(['dog', 'bat', 'animal', 'bird'])
******* The first letter of animal is A