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

Same issue with similar problem to before!

Apparently cannot convert a str into int implicitly - which I knew - but not sure why it would be the case here!

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

2 Answers

Steven Parker
Steven Parker
231,269 Points

The .index function searches a list for an item. The item should be the same type as the elements of the list.

But that's not what you want here anyway, you already know the index. You want to get the item at index 0.

:point_right: That's done by subscripting, using the index in brackets (like: "item[0]").

Petko Delchev
Petko Delchev
7,417 Points

Hi all,

look I did the subscripting, but still bummer...

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