-
-
Save parzibyte/c040b1c534e59641be88ede2bc7df398 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 | |
""" | |
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