t = [[1,2,3],[4,5,6],[7,8,9]]
len(t)
3t[0]
[1, 2, 3]t[0][0]
1
#相当于一个3X3的矩形
t1 = t
t1
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]t2 = t1
t1[0] = 0
#这里只改变了t1t1
[0, [4, 5, 6], [7, 8, 9]]t
[0, [4, 5, 6], [7, 8, 9]
#即不论改变t1还是t2原来的t列表都会改变#创造一个不改变原来列表的全新的列表
t2 = t[:]
t2
[0, [4, 5, 6], [7, 8, 9]t2[0] = 1
t2
[1, [4, 5, 6], [7, 8, 9]]t
[0, [4, 5, 6], [7, 8, 9]]