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 trial

Python Python Basics (2015) Shopping List App Break

Jesse Miller
Jesse Miller
7,920 Points

Not 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?

breaks.py
def loopy(items):
    for i in items:
      if i =="STOP":
        break
      else:
        print i

1 Answer

Steven Parker
Steven Parker
231,248 Points

This course uses Python version 3.

:point_right: 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.