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 trialPiyut Dyoni
Android Development Techdegree Student 1,981 Pointswhy still wrong? challenge 3 of 3, messy collection
i dont kniw why it is still wrong?
messy_list = [5, 2, 1, 3, 4, 7, 8, 0, 9, -1]
# Your code goes below here
clean_list=messy_list[:]
clean_list.sort()
silly_list=reversed(messy_list[::3])
3 Answers
anil rahman
7,786 PointsTake out your reversed function and last line and should work
messy_list = [5, 2, 1, 3, 4, 7, 8, 0, 9, -1]
# Task 1: copy using [:] syntax
clean_list = messy_list[:]
# Task 2: sort using sort() method
clean_list.sort()
# Task 3:Now, create a variable named silly_list that is every third item,
# backwards, from messy_list.
silly_list = messy_list[::-3]
Anthony Dvoracek
1,141 PointsI have a question.
I had the following, and I'm curious why the following wasn't working:
silly_list = messy_list[:]
silly_list[::-3]
Doesn't this give you the same result, or why wouldn't this pass it?
Thank you!
anil rahman
7,786 PointsI don't know python, i figured it using google and stuff so i wouldn't be able tell you why your specific code wasn't viable. Maybe the code is viable but the code challenge wanted you to use a specific way and that's why it is failing it.