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 trialSean Clayton
Courses Plus Student 1,029 PointsCan you verify what's gone wrong?
I can't see where I'm going wrong with my code. I've worked through a number of times and I'm worried I'm missing something fundamental. I have checked, re-written and checked the code again and I can't find where I'm going!
Any help would be appreciated!
def loopy(items):
# Code goes here
for thing in items:
if thing == "STOP":
break
else
print(thing)
1 Answer
David Evans
10,490 PointsHi Sean,
You're very close.
Your conditional statement is just missing a : on your else statement.
def loopy(items):
# Code goes here
for thing in items:
if thing == "STOP":
break
else:
print(thing)
Sean Clayton
Courses Plus Student 1,029 PointsSean Clayton
Courses Plus Student 1,029 PointsPerfect, thanks! I know it would probably be something simple I had completed glossed over! Thanks for your help!