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

I'm not getting where i am wrong

??

breaks.py
items = ['abc','xyz']
def loopy(items):
    # Code goes here
    for item in items:
        if item != 'abc':
            print(item)
        else    
            continue
loopy()        

1 Answer

Nick Gaudio
seal-mask
.a{fill-rule:evenodd;}techdegree
Nick Gaudio
Python Web Development Techdegree Student 2,133 Points

Two things:

1) Add a colon after your else. You need that for proper syntax.

2) When you're calling loopy at the end you need to put in the argument for the function. In this case, the argument is items. So just add the word items in between the parenthesis.

A useful technique for these quizzes is to just copy this quiz code into workspaces into a separate script and then troubleshoot it from there. Python errors would have shown you what you needed to change. Cheers!