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
Y B14,136 Points
Some items not working with map challenge
I can't pass the challenge as it seems some items aren't working unfortunately for some reason?
backwards = [ 'tac', 'esuoheerT', 'htenneK', [5, 4, 3, 2, 1], ] def reverse(iter): return sorted(iter, reverse=True) forwards = map(reverse, backwards)
Chris FreemanTreehouse Moderator 68,390 Points
sorted will create a list from a string, sort it, then reverse it. So strings don't remain strings, and the order is changed before reversing order.
A simpler reversal is to use slice notation
sorted should not have passed the challenge. A note has been sent to Kenneth Love to improve the challenge checker for Task 1. Thanks for catching this bug!