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 trialPiyut Dyoni
Android Development Techdegree Student 1,981 PointsI dont understand the challenge.. iterable function challenge
Hi, I dont understand the challenge, I wrote exactly what he said but he wanted kaoa as the result. what did it mean?
def first_4(iterable):
return iterable[:4]
def odds(iterable):
new_item=[]
for item in iterable:
if iterable.index(item)%2==0 :
continue
new_item.append(item)
return new_item
1 Answer
Steven Parker
231,236 PointsThe "kaoa" is just the expected result of one of the challenge's internal tests. What's significant is that the expected result was a string but your function built and returned an array.
Hint: this challenge is about using slices.
If that hint isn't enough, you might want to review the Slicing With A Step video.