Dictionary deep copy : Dictionary Copy « Dictionary « Python





Dictionary deep copy

Dictionary deep copy
from copy import deepcopy
d = {}
d['names'] = ['Alfred', 'Bertrand']
c = d.copy()
dc = deepcopy(d)
d['names'].append('Clive')
print c
print dc


           
       










Related examples in the same category

1.Copy a dictionaryCopy a dictionary
2.Dictionary copyDictionary copy