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!
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 trial
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,886 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.