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 trialyan qingsong
15,282 PointsI don't understant
If the current item's index 0 is the letter "a" I dont' understan what is that mean
def loopy(items):
# Code goes here
for item in items:
if item == "a":
continue
else:
print(item)
1 Answer
Steven Parker
231,248 PointsYou are very close. The "item's index 0" is represented by this: item[0]
. The brackets serve as the "indexing operator".
So your fourth line should look something like this:
if item[0] == "a":
Joseph Diodato
928 PointsJoseph Diodato
928 PointsHi Yan,
For the current item's index 0 to be the letter "a" means that the first letter of the string (item) is "a." Notice how if the letter at index 0 is "a", the loop will continue, but you only want to print the item if the letter at index 0 is not "a"
I suggest you review indices, to refresh your mind on finding the particular index of a string that you're looking for. After that, you'll want to find a way to only print the item if it does not begin with the letter "a". I hope that helps!