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 trialGöktuğ Özdem
441 PointsI need help about the question :)
-
def loopy(items):
for x in items:
if x.index(0)="a":
continue
else:
print(x)
2 Answers
Ari Misha
19,323 PointsHiya Goktug! I'd say your logic is on the point but i think you need to refactor a code little with these couple of point:
- first off, it should be "==" not "=" , im guessing its a typo right?
-second off, you cant say 'x.index(0)' coz it'd raise an AttributeError saying 'int' object has no attribute 'index'. Perhaps, you might wanna try
if x[0]=='a':
. Everything else seems alright to me (:
Göktuğ Özdem
441 PointsHey Ari, I often get error about the syntax and I think it is because I am new to python :) Probably I will need help about other questions :D Thanks for your time !