Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created March 24, 2018 17:02
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 Fhernd/d5a1c15ea5828260d877a80e2396b9f0 to your computer and use it in GitHub Desktop.
Save Fhernd/d5a1c15ea5828260d877a80e2396b9f0 to your computer and use it in GitHub Desktop.
Remoción de duplicados en un secuencia. OrtizOL.
def remover_duplicados(secuencia):
elementos_iterados = set()
for elemento in secuencia:
if elemento not in elementos_iterados:
yield elemento
elementos_iterados.add(elemento)
lista = [3, 11, 19, 3, 5, 7, 21, 5, 29]
print(list(remover_duplicados(lista)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment