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 trialChris H
Python Web Development Techdegree Student 1,368 PointsBreaks challenge
Not sure why i am not passing?
def loopy(items):
for loppy in (items):
if character at index o == "a":
continue
print(current member)
2 Answers
Austin Flagler
10,227 Pointsfirst of all, instead of "character at index 0", we have to use item[0], which is the proper way to reference the place in the location in the Item string. Also, along with that when you are printing the item, you must print this "item" that we are using. The code should look something like this.
def loopy(items):
for item in (items):
if item[0] == "a":
continue
print(item)
Chris H
Python Web Development Techdegree Student 1,368 PointsThanks got it now, also going to back track and do some reviewing.
Austin Flagler
10,227 PointsThere is a few things wrong with your code that I can see. Take another look at line 3 and line 5.
Brian Boring
Courses Plus Student 3,904 PointsBrian Boring
Courses Plus Student 3,904 PointsThe challenge is as follows;
You are moving in the right direction, except for a few missteps. You are correct that you need to cycle through (items). You have chosen to cycle through items applying each item to the variable "loppy". (Not sure if you meant to call it loopy, but that doesn't really matter, apart from slightly confusing to read. I would name it "item".) With each cycle of (items) contents, you are correct that you want to compare the item at index 0 with "a", but your syntax is off. If I was cycling through (items) using the variable "item", I would call the thing within items at the 0 index "items[0]". So apply that to what you're doing here. Also, "a" should be in parenthesis.
Lastly, you want to say, if this happens, continue... ELSE, print. Also remember that indexing matters in python.
I hope this helps without giving too much of it away.