fork download
  1. from copy import deepcopy
  2. d = {}
  3. d['names'] = ['Alfred', 'Bertrand']
  4. c = d.copy()
  5. dc = deepcopy(d)
  6. d['names'].append('Clive')
  7. print(c)
  8. print(dc)
Success #stdin #stdout 0.03s 10240KB
stdin
Standard input is empty
stdout
{'names': ['Alfred', 'Bertrand', 'Clive']}
{'names': ['Alfred', 'Bertrand']}