Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Created July 28, 2020 13:26
Show Gist options
  • Save FerdinaKusumah/1ad7b660915f8725b34de804a2ea279f to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/1ad7b660915f8725b34de804a2ea279f to your computer and use it in GitHub Desktop.
[Python] Clone variable
from copy import deepcopy
"""Copy or clone variable"""
a = [1, 2, 3]
b = deepcopy(a)
"""Try to add another data in a"""
a.append(4)
# a = [1, 2, 3, 4]
# b = [1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment