Python Python Basics (2015) Shopping List App Continue

RMZ .
RMZ .
1,002 Points

continue

Can somebody help me out? My question is, should I make a list first? or what should I do? a bit confused with the command. Thank you and have a great weekend people!

breaks.py
def loopy(items):
    if current_item [0] == "a":
        continue
    else:
        print ([1])
    # Code goes here

1 Answer

Jacob Anderson
Jacob Anderson
6,718 Points

Hey there :)

The list you need, items, is being passed to the function so you're all good on that front. What you're missing is the loop, which lets you check each position in the list one by one.

Heres what you did wrong:

  • Forgot the loop to check each item
  • Your print is slightly off, but it's due to the loop being there

That format of 'for thing in things' I find quite nice to read, it should help you get a good idea of what you're doing.

This answer should work for you:

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