Slice a list of lists?
Andreas Waldenburger
usenot at geekmail.INVALID
Wed Sep 8 15:12:30 EDT 2010
Let me rephrase what I wrote a bit.
On Wed, 8 Sep 2010 15:08:11 -0400 Andreas Waldenburger
<usenot at geekmail.INVALID> wrote:
> > a[0][:]=[1,2,3]
> Here you're making a list of all elements of the first element of a.
>
That is, you're making a copy of the first element of a.
> > a[:][0]=[1,2,3]
> >
> And here you're selecting the first element of all elements of a.
>
That is, you're taking the first element of a copy of a.
I hope this is a little less confusing.
/W
--
INVALID? DE!
More information about the Python-list
mailing list