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 trialNick Ross
4,944 PointsWhat is my error
I can't identify the error despite all the necessary formatting. It still says didnt find the right item.
def loopy(items):
for item in items:
if item == 'STOP':
break
else:
print(item)
2 Answers
Jennifer Nordell
Treehouse TeacherHi 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!
Michael Liebegott
3,960 PointsHey 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.
Chris Freeman
Treehouse Moderator 68,441 PointsChris Freeman
Treehouse Moderator 68,441 PointsThis 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.