My loopy function needs to skip an item this time, though
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".
Can you tell me where am I wrong?
def loopy(items): for item in items: if item == 'a' continue elif: print(item)
Also I just realized you are using
continue. It should not be used in this case. The body of your for loop should only have 1 statement like:
if item != 'a': print(item)
You would only use
elif if you were testing an additional condition. Since you are not, you should replace it with