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 -- http://mail.python.org/mailman/listinfo/python-list
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 -- http://mail.python.org/mailman/listinfo/python-list