This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from copy import deepcopy | |
x=[1,2,[3,4]] | |
#deepcopying x | |
y=deepcopy(x) | |
#Nested list inside list x and y also different list objects.Their id (memory location) is different. | |
print (id(x[2]))#Output:52662600 | |
print (id(y[2]))#Output:52795592 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment