Skip to content

Instantly share code, notes, and snippets.

@masasa27
Created August 1, 2020 19:16
Show Gist options
  • Select an option

  • Save masasa27/e2c712624ac32b0da08d09dec3d099af to your computer and use it in GitHub Desktop.

Select an option

Save masasa27/e2c712624ac32b0da08d09dec3d099af to your computer and use it in GitHub Desktop.
lst copy
lst = [1, 2, 3]
lst3 = lst # copy the list memory location, lst3 and lst are the same object!
lst2 = lst[:] # copy the list values, and not the memory location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment