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

Aakriti Singh
Aakriti Singh
442 Points

what is the problem In this code ?

is there any indentation problem?

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

2 Answers

Hi there,

You're right, there is an issue with indentation, but you're close. The 'if' and 'else' should lined up, and indented inside the 'for'. There's also a missing ':' at the beginning of the for loop, and at the beginning of the function. Something like this would work:

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

Hope this helps!

Aakriti Singh
Aakriti Singh
442 Points

I don't now what is the problem because even after doing it your way ..it's still not working

Aakriti Singh
Aakriti Singh
442 Points

even after doing this it's showing error....

Hi there - you're right, if I copy-paste mine it works, but I also tried copy-pasting yours and making the changes, and it doesn't..hmm. They look the same, but trying to figure that out.

Ooh, wait, think I got it - in yours there's also a : missing on the first line, defining the loopy function. With the other changes, that fixed it for me - let me know if that works!