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 trialEdgar Vaquerano
1,254 PointsIt think there's something wrong with your checker for challenge 4/4:
It think there's something wrong with your checker for challenge 4/4: answer: def reverse_evens(num): return num[-1::-2]
does return [5,3,1]
def first_4(num):
return num[:4]
def first_and_last_4(num):
return num[:4]+num[-4::1]
def odds(num):
return num[1::2]
def reverse_evens(num):
return num[-1::-2]
2 Answers
Vittorio Somaschini
33,371 PointsHi Edgar.
I am not really sure what the first -1 would mean in this case. But I think for this part it is easier to split the task in 2 steps inside the function. First get the even indexed values and then reverse the order. This will make things much easier! If you got to this point (part 4/4), I'm sure you can do it. ;)
Vitto
Ker Zhang
Full Stack JavaScript Techdegree Graduate 29,113 Pointsi ran into same problem. The following code words in my Terminal without any problem but the challenger checker keeps reporting error.
def reverse_evens(v): print(v[::-2]) return v[::-2]