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 Break

What is my error

I can't identify the error despite all the necessary formatting. It still says didnt find the right item.

breaks.py
def loopy(items):
    for item in items:
        if item == 'STOP':
            break
        else:
            print(item)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! My best guess as to why you're receiving an error is that you're working on Step One of the challenge. The code you've listed above will not work for that particular step as it doesn't meet the criteria for the challenge. My suggestion to you is to re-read the instructions.

That being said, the code you posted above will pass Step Two of the challenge, so make sure to keep it handy!

Hope this helps! :sparkles:

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

This challenge is unusual, in that, the code that passes the last task will not pass the earlier tasks if present from the beginning. No cut-and-paste solution on this one.

Hey there Tech!

Are you trying to submit this answer for Part 1 of the challenge? I ran your code for Part 2 and it worked perfectly, so there's nothing wrong with your syntax or content.