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 trialJoaquim Moraes
2,312 PointsGeneric "Bummer! Try again!" message without much other help.
So the exercise instructs to loop through every item in items. If the current item's index 0 is the letter "a", continue to the next one. Otherwise, print out every member of items. When I check my work I am simply given a "Bummer! Try again!" message. Can anyone shed more light as to what could be wrong with my code. Thank you in advance.
def loopy(items):
# Code goes here
for item in items:
if item[0] == 'a':
continue
print item
3 Answers
Carlos Federico Puebla Larregle
21,074 PointsRemember that "print()" is a function so you have to use the parenthesis. You could do it like this:
def loopy(items):
for item in items:
if item[0] == 'a':
continue
print(item)
I hope that helps a little bit
Carlos Federico Puebla Larregle
21,074 PointsYou have to be careful with the indentation when writing python. For example, use 4 white spaces for indentation every time so you don't end with that kinda of error.
Joaquim Moraes
2,312 PointsThank you for your feedback Carlos. That was the issue.
Joaquim Moraes
2,312 PointsThank you Carlos. I get it now. I appreciate your help.
Joaquim Moraes
2,312 PointsJoaquim Moraes
2,312 PointsThanks for calling that out. It's something that I keep overlooking and must do a better job. However, even after adding the parenthesis; I still received the generic Bummer message.
fmpevezqrf
1,162 Pointsfmpevezqrf
1,162 PointsThank you. Helped a lot! Made me understand "for" loops better too.