这里是输出的屏幕截图。请解释为什么它会以这种方式工作,并向我提供有关如何制作列表列表副本的解决方案
matrix = [['I','A','O','O','I'],['I','A','O','O','I'],['I','A','O','O','I'],['I','A','O','O','I'],['I','A','O','O','I']]
matrix_1d = ['I','A','O','O','I']
matrix2 = matrix.copy()
matrix2_1d = matrix_1d.copy()
def printMat(m):
for i in range(len(m)):
print (m[i])
matrix[0][0] = 'lol'
matrix2[0][1] = 'kek'
matrix_1d[0] = 'lol'
matrix2_1d[1] = 'kek'
printMat(matrix)
print("_")
printMat(matrix2)
print("_")
print(matrix_1d)
print("_")
print(matrix2_1d)