copy.deepcopy() function : Copy : Buildin Module PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Module » Copy »

 

copy.deepcopy() function


person = ['name', ['savings', 100.00]]
personClone = person

import copy
personDup = copy.deepcopy(person)
print [id(xfor x in person, personClone, personDup]
personClone[0'joe'
personDup[0'jane'
print personClone, personDup
personClone[1][150.00
print personClone, personDup



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Module
» Copy