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 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.

breaks.py
def loopy(items):
    for item in items:
        if [0] in items == "a":
            continue
        print(items)

1 Answer

Jeffrey James
Jeffrey James
2,636 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