(1)值替換
[python] view plain copy
import copy
d = {
'name' : ['An','Assan']
}
c = d.copy()
dc = copy.deepcopy(d)
d['name'] = ['an']
print c
print d
print dc
結果如下:
[python] view plain copy
{'name': ['An', 'Assan']}
{'name': ['an']}
{'name': ['An', 'Assan']}