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

I do not understand what the challenge is asking. Is there another way to ask the challenge? The wording is confusing.

I have tried different working versions of code. However, I do not understand what the challenge is asking for. If I read word for word then here is what I interpret.

Loop through items to look at each member If the member is an "a" then continue to the next member If it is not an "a" then print all the items

This would result in printing the list for each member in items that is not an "a". The wording of the challenge is not clear to me.

1 Answer

Kourosh Raeen
Kourosh Raeen
23,733 Points

You need to loop through the items list. Inside the loop you use an if statement to see if the current item in the loop starts with an "a". If it does you skip by using the continue keyword, otherwise you print that item. In the end, you end up printing only those items in the list that start with an "a". Here's the code:

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

Thanks for the answer. I did figure it out and completed the challenge.