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 trialMichael Rasay
2,860 Pointsbreaks.py: I am now lost. Please help!
Hello! I am trying to follow the challenge step by step and now lost.
Can you please help and explain so I can easily digest the resolution?
Thanks!
def loopy(items):
# Code goes here
for item in items:
if 0 == 'a':
continue
else:
print(item)
john larson
16,594 PointsSara has pinpointed the crux of the problem. I'll add a bit more. Using indexes is a very useful way to access bits of code. So getting comfortable with it will serve you well. You have the 0. That's a start.
- 1: What is the thing you want the 0 index of.
- 2: How will you access it.
2 Answers
Michael Rasay
2,860 PointsGot it! Thank you so much!!
def loopy(items): # Code goes here
for item in items:
if item[0] == 'a':
continue
print(item)
john larson
16,594 PointsThat's cool, I didn't think about leaving out the else clause, but that worked just fine :D
Michael Rasay
2,860 PointsThank you John and Sara! Great pointers!
Sara Watson
Courses Plus Student 3,713 PointsSara Watson
Courses Plus Student 3,713 PointsHave a look at your condition statement,
if 0 == 'a':
That will never be true, right? What you want to do is use item to access the character at index 0.
You are close.