I am confused by

Martin Rixham martin.rixham at gmail.com
Wed Sep 7 18:57:04 EDT 2011


Hi all
I would appreciate some help understanding something. Basically I am
confused by the following:

>>> a = [[0, 0], [0, 0]]
>>> b = list(a)
>>> b[0][0] = 1
>>> a
[[1, 0], [0, 0]]

I expected the last line to be

[[0, 0], [0, 0]]

I hope that's clear enough.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110907/c228dd3f/attachment.html>


More information about the Python-list mailing list