-
-
Save redrambles/c099b771a76e7ade81b5fb463b72126b 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
def remove_duplicates(lista): | |
lista2 = [] | |
for item in lista: | |
if item not in lista2: #is item in lista2 already? | |
lista2.append(item) | |
return lista2 | |
print(remove_duplicates([1,2,3,3])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice. I expanded on the idea; included "if else" logic & pre-populated "lista2"