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 trialAlexander Pavlenko
654 PointsCould someone please help me here?i feel like i am doing everything right, but smth is wrong.
.
def loopy(items):
for item in items:
if item.index('a') == 0:
continue
else:
print(item)
# Code goes here
2 Answers
Dan Garrison
22,457 PointsYou 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
654 PointsThanks , 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?