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 trialRMZ .
1,002 Pointscontinue
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!
def loopy(items):
if current_item [0] == "a":
continue
else:
print ([1])
# Code goes here
1 Answer
Jacob Anderson
6,718 PointsHey 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)