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

Program working fine in workspace but not in exercise (task)

def loopy(items): # Code goes here for m in items: if m.index("a") == int(0): continue else: print (m)

breaks.py
def loopy(items):
    # Code goes here
    for m in items:
        if m.index('a') == 0:
            continue
        else:
             print (m)

1 Answer

Steven Parker
Steven Parker
229,980 Points

You're close, but it looks like you sort of flip-flopped the concept. Here's a few hints:

  • you don't want to test if the index of 'a' is 0.
  • you do want to test if the letter at index 0 is 'a'
  • remember that indexing is done with brackets []

I'll bet you can get it now.

Thanks buddy !