>>> a = [[] for i in xrange(4)]
>>> a
[[], [], [], []]
>>> b = [a for i in xrange(3)]
>>> b
[[[], [], [], []], [[], [], [], []], [[], [], [], []]]
>>> b[0][0]=1
>>> b[2][0]=10
>>> b[1][0]=2
>>> b
[[2, [], [], []], [2, [], [], []], [2, [], [], []]]
なんでこうなるの?
Tweet
0 件のコメント :
コメントを投稿