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

Benny Shtark
Benny Shtark
743 Points

for some reason the challenge doesnt work, even tho it seems i did properly. items = ["abc","xyz","bbb"];

for some reason the challenge doesnt work, even tho it seems i did properly.

breaks.py
def loopy(items):
    for item in items:
        if item[0] is "a":
            continue
        else:
            print item
loopy(items)

2 Answers

Your code is really close! The code challenge works fine :)

Two errors:

  • The code challenge automatically calls your function, it just causes an error (it will just say "Bummer!" it wouldn't cause any errors in Python).
  • You need parentheses for the print function. print in Python 2 and print in Python 3 are different.

You did a great job. It is normal to run into these kind of errors :) Don't worry it happens to everyone.

If you fix those, your code should look like:

breaks.py
def loopy(items):
    for item in items:
        if item[0] is "a":
            continue
        else:
            print(item)

Good luck! ~alex

Benny Shtark
Benny Shtark
743 Points

Thanx alot!!

I still cant get used to all this syntax.. its quite different from bash :D

David Lin
David Lin
35,864 Points

Almost ...

You don't need to call loopy, and you need to add parentheses around print (item):

def loopy(items):
    for item in items:
        if item[0] is "a":
            continue
        else:
            print (item)
Benny Shtark
Benny Shtark
743 Points

Thanx!

just solved that