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

Can't seem to figure out my mistake on the continue exercise.

I have been staring at this code for a while and can't seems to see the error.

breaks.py
def loopy(items):
    # Code goes here
    for letter in "items":
        if letter [0]=="a":
        continue
    else:
        print(items)

1 Answer

Kourosh Raeen
Kourosh Raeen
23,733 Points

Hi Christopher - items should not be in quotation marks:

for letter in items:

You also need to correct the indentation:

def loopy(items):
    # Code goes here
    for letter in items:
        if letter[0] == 'a':
            continue
        else:
            print(letter)

I also suggest using a different variable name instead of letter, something like item, although it's not necessary for the code to work.

Thank you!! That helped me a lot.