A simple question

nnorwitz at gmail.com nnorwitz at gmail.com
Sat Mar 4 23:32:44 EST 2006


Skip answered why, but not how to make it work right:

>>> x = [[0]*2 for x in range(2)]
>>> x
[[0, 0], [0, 0]]
>>> x[0][1]=1
>>> x
[[0, 1], [0, 0]]

Cheers,
n




More information about the Python-list mailing list