Simple list.append() question

Fredrik Lundh effbot at telia.com
Tue Apr 25 02:36:43 CEST 2000


Bill Wilkinson <bwilk_97 at yahoo.com> wrote:
> l = [[][:]] * 3

same problem as the original code:

>>> l = [[][:]] * 3
>>> l
[[], [], []]
>>> l[0].append(1)
>>> l
[[1], [1], [1]]

</F>





More information about the Python-list mailing list