Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created August 30, 2021 22:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
original_list=[1,2,3]
#Copying list using assignment operation
copied_list=original_list
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:
print(id(copied_list))
#Output:26751688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment