-
-
Save IndhumathyChelliah/d98160530b7ddb35778e1984dc94e888 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
original_list=[1,2,3] | |
#Copying list using copy function | |
copied_list=original_list.copy() | |
print(copied_list) | |
#Output:[1, 2, 3] | |
print(original_list) | |
#Output:[1, 2, 3] | |
#checking the id of both original and copied list | |
print(id(original_list)) | |
#Output:27800264 | |
print(id(copied_list)) | |
#Output:27799880 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment