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 Second Shopping List App

abdul hakkim
abdul hakkim
2,745 Points

continue code challenge

code challenge on continue some one can help me!!!!!!!!!

Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

What have you tried so far? Do you still need help?

abdul hakkim
abdul hakkim
2,745 Points

tried could not figure out please help

Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

Can you please post the latest version of your code?

abdul hakkim
abdul hakkim
2,745 Points

This is my latest try:----

def loopy(items):
    # Code goes here
    while True:
        if items['0']=='a':
            continue
        else:
            print(items)

[MOD: added ```python formatting -cf]

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

items[0] is the first item in the input list and not the first character of a given item.

Under what condition does the while loop exit?

  • change the while loop to a for loop on item in items:
  • change the if to compare item[0] instead of items[0]
abdul hakkim
abdul hakkim
2,745 Points

Thank you very much Mr.chris for your explaination and helping i got cleared challenge

I was trying to do the above but was attempting to use the index function. Was I reading way too much into it? Above I see you just used:

def loopy(items):
    for item in items:
        ***if item['0']=='a':*** <---This line
            continue
        else:
            print(item)

Is this the basic format for finding items as a certain index value?

if item['IndexValue']=='DesiredCharacter'
Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

Tony, indexes into lists should be an integer, not a string.

The form using a string item['key'] is used to look up values in the item dict.