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

Going loopy.. any help for the challenge question.

Hi, I feel like I might be close to the answer. Can anyone help?

breaks.py
def loopy(items):
    # Code goes here
    for thing in items:
        if 0 in items == "a":
            items.remove(0)
        else:
            print(items)

1 Answer

Tim Betz
Tim Betz
15,146 Points

The challenge wants you to check the first letter in every item. Your if-statement doesn't make much sense right now. You need to use square brackets to access a specific position of the string. Also, the challenges states, that you don't need to remove the item, but only skip it with the keyword "continue". So your code should look something like this:

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

Hi Tim, That makes allot more sense - I made a mistake and learned something new! Thanks for taking the time to respond.