[Tutor] packing a list of lists

Kent Johnson kent37 at tds.net
Fri Aug 28 20:39:37 CEST 2009


On Fri, Aug 28, 2009 at 10:28 AM, kevin parks<kp8 at mac.com> wrote:
> Interestingly changing:
>                out_list.append(ll)
>
> to
>
>                out_list.append(list(ll))
>
>
> seems to work. The part of my brain that understood why that is must have
> sleeping.

Because it makes a new list instead of appending many references to
the same list.

Kent


More information about the Tutor mailing list