Created
May 31, 2020 22:27
-
-
Save parzibyte/0a91e281d3d949b5ab1eaf4c666f4e28 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
lista = [1, 2, 3] | |
otra_lista = lista[:] | |
print("lista:") | |
print(lista) | |
print("otra_lista:") | |
print(otra_lista) | |
# Modificar a lista | |
print("Modificando...") | |
otra_lista[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