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 trialJesse Miller
7,920 PointsNot sure why it's not going through...
I put in this code, but for some reason it's not going through. def loopy(items): for i in items: if i =="STOP": break else: print i
Is it just wrong? Or do I have an issue with indentation?
def loopy(items):
for i in items:
if i =="STOP":
break
else:
print i
1 Answer
Steven Parker
231,269 PointsThis course uses Python version 3.
In Python 3, print is a function, and must have parentheses around the argument(s).
Maybe you had some experience with Python 2? I believe your syntax would have worked as-is then.