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 trialParimal Raghavan
Courses Plus Student 1,940 PointsTask is unclear, is the items a list somehow? I want to known the correct solution.
I am unsure what to do here. To print everything in items, items must be a list. Do we also execute the command and give items a list value?
1 Answer
Steve Hunter
57,712 PointsHi there,
Yes, items
holds multiple things; a list or an array. You need to loop through and print each item but stop if you find the string "STOP". Test for that first, then execute the rest of the loop:
def loopy(items):
# Code goes here
for item in items:
if item == "STOP":
break
print(item)
I hope that helps,
Steve.
Parimal Raghavan
Courses Plus Student 1,940 PointsParimal Raghavan
Courses Plus Student 1,940 PointsI get it now! Thank you!