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 need help with this one

how do i go through this

breaks.py
def loopy(items):
    if item == '0':
        continue

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Tanaka.

For this challenge, the Task is asking quite a few things for you to do.

First it is asking to loop through all the items. To do this, you will need to use a for in loop. With each loop of the for in loop, it asks you to check if the current item's index Zero (not an 'o') is the letter "a." If it is you continue to the next iteration in the loop, if it isn't, then print out the current item.

To do this, you will put an if statement inside of the loop. "If" it is "a" the continue. If it isn't, move to the else statement and print out the item. ... Now do the loop again.

I've included the corrected code for your reference. Have a look and then follow the code along with the instruction. If it still doesn't make complete sense, please review the video again, as loops and conditionals are going to play a large part of the rest of the course.

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

Keep Coding! :) :dizzy: