Created
July 28, 2020 13:26
-
-
Save FerdinaKusumah/1ad7b660915f8725b34de804a2ea279f to your computer and use it in GitHub Desktop.
[Python] Clone variable
This file contains hidden or 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
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