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 trialRyan Dau
428 Pointsbreaks.py
I do not understand why the code is not working...
def loopy(items):
for loopy in items:
print(items)
if items == "STOP":
break
3 Answers
Cole Wilson
7,413 PointsI think the function name loopy and iteratable variable loopy are getting confused.
Try replacing line 2 with:
for thing in items:
Then replace your usage of items in the print and if with thing.
Cole Wilson
7,413 PointsWas able to test using Python 3.3
Ryan Dau
428 Pointsyea from trial and error after what you said i got it to work, simple mistakes
Cole Wilson
7,413 PointsNice! Best way to learn.
Cole Wilson
7,413 PointsCole Wilson
7,413 PointsThis is what I was trying to say. I believe this should work. I'm on my mobile and can't test easily.