>>> import copy
>>> spam = [1, 2, 3]
>>> cheese = copy.copy(spam)
>>> cheese[1] = 42
>>> cheese
[1, 42, 3]
>>> spam
[1, 2, 3]
>>> kat = copy.deepcopy(spam)
>>> kat[2] = 400
>>> kat
[1, 2, 400]
>>> spam
[1, 2, 3]
copy函数的存在即为了解决列表或者字典传递时,修改当前变量的值不影响原来列表或者字典的值。此时的spam和cheese指向了不同的列表
deepcopy同理