Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 26, 2020 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/cfaca7630abfdb88e0c1c7bd516e2412 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/cfaca7630abfdb88e0c1c7bd516e2412 to your computer and use it in GitHub Desktop.
x=[1,2,[3,4]]
#Copying x
y=copy(x)
#Both list elements are same
print (x)#Output:[1, 2, [3, 4]]
print (y)#Output:[1, 2, [3, 4]]
#But both are different list objects. so their id is not same.
print (id(x))#Output:52073768
print (id(y))#Output:52205992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment