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 (2016, retired 2019) Slices First Slice

Copy a list with slices

I am doing the quiz for slices and there is this question where they ask how to copy a list with slices.

they want you to copy a_list = [1, 2, 3]

I know how to make a copy, for instance:

a_list = [1, 2, 3]
my_list = a_list[:]

which copies the entire a_list. But I don't know what to type in to get it right.

2 Answers

Steven Parker
Steven Parker
229,785 Points

The blank in the question only represents the slice syntax. It might be confusing because the copy being made won't be saved anywhere (there's no assignment being made).

So just answer with the characters you would add to the list to make a copy.

Steven, thank you so much for the help.

That's horrible -- some of these questions are awful to try and figure what they're asking for. Grade = F.

I agree with you Burton King . These code challenges are worded terribly and the videos suck!