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

Why isn't treehouse accepting this code

I'm pretty sure this is correct, However I keep getting an error from the Treehouse Software

breaks.py
def loopy(items):
    # Code goes here
    for i in items:
        if i == 'STOP':
            break
        else:
            print (i)

Maybe try again. I just passed with your code.

2 Answers

Daniel Gauthier
Daniel Gauthier
15,000 Points

Hey Mister,

Echoing alexey kislitsin and Jason Anello here.

Your code is correct and passes when thrown into the challenge, so I'd suggest copying the code you have, refreshing your browser, then pasting the code back in as a first step when you run into this issue.

Sometimes the parser breaks and will reject anything you throw at it until you refresh the page. It's inefficient, but at least you'll have one more potential solution to obstacles you run across on this site.

The good news is, you had the answer correct :D

Good luck with the course!