-
-
Save IndhumathyChelliah/cfaca7630abfdb88e0c1c7bd516e2412 to your computer and use it in GitHub Desktop.
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
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