Created
May 31, 2020 22:53
-
-
Save parzibyte/6a10f6a31abfd2ce7b596de20093e86c to your computer and use it in GitHub Desktop.
This file contains 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 | |
lista = [ | |
[1, 2], | |
[3, 4], | |
] | |
otra_lista = deepcopy(lista) | |
print("lista:") | |
print(lista) | |
print("otra_lista:") | |
print(otra_lista) | |
# Modificar a lista | |
print("Modificando...") | |
otra_lista[0][0] = 4 | |
# Y al imprimir, no debería haber modificado a "lista" | |
print("lista:") | |
print(lista) | |
print("otra_lista:") | |
print(otra_lista) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment