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!
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 trial
I need some help in this task
I have no clue about solving this problem. But I know how to do it mentally but writing the correct logic for this question is tough for me.
def loopy(items): # Code goes here for a in items: if a.index(0)=="a": continue else: print a
William LiCourses Plus Student 26,867 Points
Couple issues here.
list.index()this method doesn't quite work like that; for example, list.index(value) will return the index position of the value on the list; thus, you need to write the comparison as
print awas the Python 2 way of outputting value; in Python 3, print is a function
hope that helps.