import copyli = [4,5]lts = [1,2,3,li]lt_copy= copy.copy(lts)lt_deepcopy = copy.deepcopy(lts)lts.append(6)lt_copy.append(7)print(lts,lt_copy) #输出[1, 2, 3, [4, 5], 6] [1, 2, 3, [4, 5], 7]li.append(8) #内部表格li插入print(lts,lt_copy,lt_deepcopy)#输出[1, 2, 3, [4, 5, 8], 6] [1, 2, 3, [4, 5, 8], 7] [1, 2, 3, [4, 5]]#可以看到当对li操作时,lt_deepcopy不受影响!