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

First Slice Quiz Python

I keep failing one of the questions on the first slice quiz and I cannot work out what I am doing wrong!

The question is fill out the blank below, copy the entire list with a slice.

I have tried to create a new list name with the answer a_list_new = a_list[:] But it didn't like that...

Then I tried using index notation but it wasn't happy and I have tried it again without the _new addition to the list and I'm still not getting it...help please!

5 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Your are on the right path. The quiz question is not looking for an equation. It just wants the form of a copied list:

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

Copy the entire list with a slice.

Thank you! I was pulling my hair out!

kevin burns
kevin burns
2,570 Points

I had a tough time too use this [:]

Blake Golliher
Blake Golliher
5,943 Points

I think the position of the cursor is misleading. It looks like it wants you to write an answer that mimics the line above.

a_list = [1,2,3] a_list _______

So I figured it must be a_list = a_list[:] which does copy the entire list. I think it might be changed to something like. "Using a slice, how would you copy the entire list in to another list?" "new_list = a_list[____]"

I also was tripped up by this question's wording.

Blake Golliher , good suggestion. I was thinking of of the wording could be changed, however, changing the actual question's format itself seems to be the better option while teaching the same lesson.

Kenneth Love

Please change the wording on this.