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

yan qingsong
yan qingsong
15,282 Points

I don't understant

If the current item's index 0 is the letter "a" I dont' understan what is that mean

breaks.py
def loopy(items):
    # Code goes here
  for item in items:
    if item == "a":
       continue
    else:
       print(item)
Joseph Diodato
Joseph Diodato
928 Points

Hi 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!

1 Answer

Steven Parker
Steven Parker
231,248 Points

You are very close. The "item's index 0" is represented by this: item[0]. The brackets serve as the "indexing operator".

:point_right: So your fourth line should look something like this:

    if item[0] == "a":