Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Shopping List App Continue

Alexander Pavlenko
Alexander Pavlenko
654 Points

Could someone please help me here?i feel like i am doing everything right, but smth is wrong.

.

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

2 Answers

Dan Garrison
Dan Garrison
22,445 Points

You are close. Remember to check the index of something, you just need to put what you are evaluating with brackets and then the index that you want to check. So it would look something like this

item[0]

In this case, you are checking if the item at index 0 is equal to "a"

Alexander Pavlenko
Alexander Pavlenko
654 Points

Thanks , Dan! Got it now. It's been a while since that index video so i forgot how to use it properly. I tried to google "python index" but tutorials were mostly bad. Do you know any good resources on how to use different functions etc?