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 trialJaime Castillo
5,800 PointsIt is glitching, It saids it is wrong. I am on the third one and it saids I am on the second one.
My code: def odds(iter): return iter[1::2]
def first_4(iter):
return iter[:4]
def first_and_last_4(iter):
return iter[:4] + iter[4:]
1 Answer
Steven Parker
231,275 PointsThis code does not solve the task 2 challenge to create "first_and_last_4". You seem to have the right idea, but the implementation isn't quite right.
Hint: check the slice arguments for "last 4".
Zara Thomas
7,522 PointsZara Thomas
7,522 PointsI have had similar problems before with other challenges. If you are 100% sure that nothing is wrong with your code, the try restarting the challenge. Sometimes that works.