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 Continue

Adam Teale
Adam Teale
10,989 Points

Bummer! Try again!

hey guys as far as I can tell this works - am running it in the python interpreter on my computer it is runs fine. Any ideas?

def loopy(items): # Code goes here for item in items: if item[0] == "a": continue else: print item

breaks.py
def loopy(items):
    # Code goes here
    for item in items:
        if item[0] == "a":
            continue
        else:
            print item

2 Answers

Michael Hulet
Michael Hulet
47,913 Points

This code will run just fine in Python 2, but Treehouse teaches and uses Python 3. In earlier versions of Python, print was a keyword, but in Python 3 and newer, print is a function, and requires parentheses around its arguments to call it properly, like this:

print("Welcome to Python 3!")

You should probably update Python on your computer with one of the downloads from the official CPython downloads page

Ari Misha
Ari Misha
19,323 Points

Hiya Adam! You're very close and i think your code is right on money but the only thing thats preventing you to proceed , are parenthesis "()". Wrap your "item" alias around parenthesis on last line of your code. Do that ad you're good to go. (: