Skip to content

Instantly share code, notes, and snippets.

@ben-n93
Created February 27, 2023 07:37
Show Gist options
  • Save ben-n93/224b921585d75505177cdade3091c287 to your computer and use it in GitHub Desktop.
Save ben-n93/224b921585d75505177cdade3091c287 to your computer and use it in GitHub Desktop.
import copy
# Using slice syntax
car_brands = ['Toyota', 'Ford', 'Honda']
car_brands_copy = car_brands[:]
# Using the copy module
car_brands = ['Toyota', 'Ford', 'Honda']
car_brands_copy = copy.copy(watch_brands)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment