Created
April 23, 2020 03:47
-
-
Save parzibyte/9d31fb8e58838942413163ed784111a3 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
""" | |
https://parzibyte.me/blog | |
""" | |
lista = ["Resident Evil 2", "Gears 5", "Cuphead", "Mortal Kombat"] | |
print("Antes de eliminar: " + str(lista)) | |
# Ahora eliminamos el del índice 1; y como comienzan en 0, sería el segundo | |
del lista[1] | |
print("Después de eliminar: " + str(lista)) | |
# También podemos usar operaciones de listas (https://parzibyte.me/blog/2018/12/18/operaciones-cortar-arreglos-python/) | |
# Eliminar desde el segundo hasta el final | |
del lista[1:] | |
print("Después de eliminar: " + str(lista)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment