Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 24, 2021 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/c040b1c534e59641be88ede2bc7df398 to your computer and use it in GitHub Desktop.
Save parzibyte/c040b1c534e59641be88ede2bc7df398 to your computer and use it in GitHub Desktop.
"""
https://parzibyte.me/blog
"""
def eliminar_impares(lista):
nueva_lista = []
for elemento in lista:
if elemento % 2 == 0:
nueva_lista.append(elemento)
return nueva_lista
lista = [100, 1000, 1044, 1, 2, 3, 4, 5, 6, 7, 8, 11, 13, 500, 12]
sin_impares = eliminar_impares(lista)
print("Original: " + str(lista))
print("Sin impares: " + str(sin_impares))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment