a = [1, 2, ['a', 'b']]
a1 = a
b = copy.copy(a)
c = copy.deepcopy(a)
a.append(3)
a[2].append('c')
print(a)
print(a1)
print(b)
print(c)

结果:

a ----- [1, 2, ['a', 'b', 'c'], 3]
a1 ----- [1, 2, ['a', 'b', 'c'], 3]
b ----- [1, 2, ['a', 'b', 'c']]
c ----- s[1, 2, ['a', 'b']]

print(id(a))
print(id(a1))
print(id(b))
print(id(c))

id(a) ---- 50472355
id(a1) ---- 5042355
id(b) ---- 8295968
id(c) ---- 50527608

结论:
1.copy()只是拷贝父对象的值,这里也就是指1,2 但是子对象(['a','b'])指向同一个内存地址
2.deepcopy()是将父子对象的值全部复制一份,与原对象无任何关系

下面是子对象的内存地址

print(id(a[2]))
print(id(a1[2]))
print(id(b[2]))
print(id(c[2]))

id(a[2]) --- 8332992
id(a1[2]) --- 8332992
id(b[2]) --- 8332992
id(c[2]) --- 50770128