-
-
Save IndhumathyChelliah/b42f5f938750f173e02530bba4f0abd7 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 x[2] and y[2] (nested list in x and y) point to same list object in memory. | |
#both id are same | |
print (id(x[2]))#Output:17797480 | |
print (id(y[2]))#Outpu:17797480 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment