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

Code challange

I have an issue to complete the challenge.

breaks.py
def loopy(items):
    # Code goes here
    for True:
        if item[0]=='a':
            continue
        else:
            print(items)

1 Answer

Thomas Fildes
Thomas Fildes
22,687 Points

Hi Elias,

You are nearly correct. The only issue is you will need to use a "for in" loop to complete this challenge. Here is the code I used to pass this challenge below:

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

Hope this helps! Happy Coding!!!

Thank you! I stared myself blind on a simple misstake hehe! :D Lucky you guys are here!

valerakushnir
valerakushnir
2,265 Points

Hi Thomas Fildes , Elias Helander any chance you could help me understand what is happing in these lines?

for item in items:
        if item[0] == "a":

I must have missed something in previous lessons ,because I don't understand where item[0] is coming from. Now that I type it out, my guess is that that is first item, since counting begins with 0.

Thanks