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 trialfisnik poroshtica
14,154 PointsI don't understand this
I am not understading what it asking to do exactly?
def loopy(items):
# Code goes here
for item in items
print(item)
break
1 Answer
andren
28,558 PointsIt wants the loop to stop when the item the loop is going though equals the string "STOP". Doing that will require that you place an if statement inside of your loop that checks if the content of the item variable equals "STOP", if it does you should use the break
keyword, as that will result in the loop stopping immediately.
Do also note that the if statement has to come before the print statement in order to complete the challenge.