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 trial

Python Python Collections (Retired) Slices Sorting Slices

Kody Dibble
Kody Dibble
2,554 Points

Python Challenge

Copy messy_list using slice syntax into a new variable clean_list.

What honestly is this even asking?

Is this asking me to copy the entire list and then reformat it into a numerical list?

Uhh quite confused.

lists.py
messy_list = [5, 2, 1, 3, 4, 7, 8, 0, 9, -1]

# Your code goes below here
clean_list = messy_list

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Make a copy instead of just pointing another variable at the list. We talked about a slice syntax for making copies of entire lists.

Kody Dibble
Kody Dibble
2,554 Points

Ok I got thanks alot! Was making it wayyyy to difficult.

Also do we learn about Qtpython and or PyQt whatever it's called in any of your videos?

Thanks again great lessons

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

I don't think I'll be covering PyQt or anything else in the Qt world. I don't know enough about it or what's actually useful for employment in that area. Maybe a guest teacher?

I probably will, though, cover the tkinter part of the standard library at some point. Probably quite awhile from now, though.