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 trialalex novickis
34,894 Pointsquiz question-posed as copy a_list = [1,2,3] to new list
I would expect the answer to be
a_list2 = a_list[:] to make a copy of the a_list
but can't enter that a_list = a_list[:] would also make a new list in the same place, but that won't accept either
2 Answers
Chris Freeman
Treehouse Moderator 68,441 PointsThe question is not looking for an equation, rather it is only looking for the syntax of a copied string:
Fill in the blank below:</br>
a_list = [1, 2, 3]
a_list*[:]*
Copy the entire list with a slice.
Peregrine Edison-Lahm
1,811 PointsI agree with Alex. I wanted to enter "a_list2 = a_list[:]" also. You get a "copy" of the output to the screen when you just use "a_list[:]", but the question (and the topic of the second half of the lesson) seems to imply that we copy it into a new variable.
Chris Freeman
Treehouse Moderator 68,441 PointsSame for me when I originally took the quiz. Maybe time for feedback Kenneth Love: maybe the question can be reworded. Thanks!
Rafael Valera
8,401 PointsIt's kind of confusing actually when it says "copy"... I even thought making a new variable "a_list_new" and then the entire list with a slace like this a_list_new = a_list[:]