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 trialYaumel Betancourt
Courses Plus Student 7,119 PointsI'm not understanding the question. I thought it was asking to skip any element on the list that has a value of "a".
def loopy(items):
for item in items:
if item == 'a':
continue
print(item)
2 Answers
jrabello
17,917 Pointshey Yaumel, your code is almost right, you're only missing the index part, you need 2 check if 'a' is at index 0 of item
jrabello
17,917 Pointsto check the first element of item we use indexing -> item[0] :)
Yaumel Betancourt
Courses Plus Student 7,119 PointsYaumel Betancourt
Courses Plus Student 7,119 PointsOk, I rewrote the code and tried it out on the terminal and it worked(printed out all of the items with the exception of the first one if it was "a"). However, I'm still getting it wrong on the challenge.