Python Python Basics (2015) Shopping List App Continue

Challenge: Make loopy function skip an item.

I cannot figure out this challenge. I've tried so many iterations of my code posted below, but nothing works and I cannot seem to figure out how to accomplish it.

"Same idea as the last one. My loopy function needs to skip an item this time, though.

Loop through each item in items again. If the character at index 0 of the current item is the letter "a", continue to the next one. Otherwise, print out the current member.

Example: ["abc", "xyz"] will just print "xyz"."

breaks.py
def loopy(items):
    for item in items:
        if item == "a".index(0):
            continue
        else:
            print(item)

2 Answers

You need your code to say if the item in the oneth place is equal to "a" continue. What your code says right now is: if "a" is at the index of zero continue. Hope this helps, Nakal

Thank you so much, nakalkucing! You explanation cleared it up. I was going by specific index on the list instead of thinking about how many items are in the list. Here was the end result:

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

Thanks! You did a great job! :) I'm glad I could help you.