A simple question

nnorwitz at gmail.com nnorwitz at gmail.com
Sun Mar 5 05:32:44 CET 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