Simple list.append() question

Fredrik Lundh effbot at telia.com
Mon Apr 24 20:36:43 EDT 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