Welcome to the Treehouse Community
Looking to learn something new?
Martin Heinvee872 Points
Solution at workplaces gives correct output but still I get a bummer, little help please!
The problem is with the function reverse_evens. Solution at workplaces gives correct output but still I get a bummer, why ?
def first_4(item): return item[0:4:1] def first_and_last_4(item2): return item2[0:4:1]+item2[-4::1] def odds(item): return item[1::2] def reverse_evens(item): return item[-1::-2]
Hi Martin! You need it to take every item with an even index and return them in reverse. You need to take every item with an even index separately from trying to reverse it. So you need to add something like this to your code:
even_index = item[::2]
This is going to take every item with an even index. I think you can figure out how to reverse this on your own. But let me know if you need any more help. :)
Alex KoumparosPython Development Techdegree Student 36,862 Points
Your last method doesn't behave the way you think it does. Try it with different length lists (both odd and even numbers of elements) and you will see why.