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 trialAakriti Singh
442 Pointswhat is the problem In this code ?
is there any indentation problem?
def loopy(items)
# Code goes here
for item in items
if item[0] == "a":
continue
else:
print(item)
2 Answers
Katie Wood
19,141 PointsHi there,
You're right, there is an issue with indentation, but you're close. The 'if' and 'else' should lined up, and indented inside the 'for'. There's also a missing ':' at the beginning of the for loop, and at the beginning of the function. Something like this would work:
def loopy(items):
# Code goes here
for item in items:
if item[0] == 'a':
continue
else:
print(item)
Hope this helps!
Aakriti Singh
442 Pointseven after doing this it's showing error....
Katie Wood
19,141 PointsHi there - you're right, if I copy-paste mine it works, but I also tried copy-pasting yours and making the changes, and it doesn't..hmm. They look the same, but trying to figure that out.
Katie Wood
19,141 PointsOoh, wait, think I got it - in yours there's also a : missing on the first line, defining the loopy function. With the other changes, that fixed it for me - let me know if that works!
Aakriti Singh
442 PointsAakriti Singh
442 PointsI don't now what is the problem because even after doing it your way ..it's still not working