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 trialeynuax
779 Pointsnot sure what I'm missing
I've added the for loop and called the function to finish it..... I'm not sure if i need to input any items somewhere - doesn't work in the parenthesis at the end calling the function? or to create an input?
help :)
def loopy(items):
for items in loopy:
print(items)
loppy()
1 Answer
Emre Havan
8,569 PointsYour first mistake is you are trying to use the function name for your iteration which is loopy. You need to make it in a way such that the function can iterate all the items in there, when its called so you should do it like: "for i in items". Then it should work.
Answer for both the first and the second task:
def loopy(items):
for i in items:
if i == "STOP":
break
else:
print(i)
Steven Parker
231,271 PointsSteven Parker
231,271 PointsTry formatting your code so the spacing shows up (in Python, indentation is everything).
Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
Or watch this video on code formatting.
eynuax
779 Pointseynuax
779 Pointsahhhh----I get it...thanks!