Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 26, 2020 03:15
Embed
What would you like to do?
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