python 实现把一维的序列循环赋值给二维的序列问题,求助a = [0,0,0,0]b = []for i in range(4):a[3] = ib.append(a)print b想实现的是:[[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 2], [0, 0, 0, 3]]可是实际是:[[0, 0, 0, 3], [0, 0, 0, 3], [0, 0, 0, 3], [0, 0, 0, 3]]求问哪里有问题?
添加回答
举报
0/150
提交
取消