Skip to content

Instantly share code, notes, and snippets.

@ooade
Created September 4, 2016 18:04
Show Gist options
  • Select an option

  • Save ooade/a656a02bd195f25b12ee73cdbb241e6a to your computer and use it in GitHub Desktop.

Select an option

Save ooade/a656a02bd195f25b12ee73cdbb241e6a to your computer and use it in GitHub Desktop.
Remove duplicates in a list
def remove_duplicates(nums):
no_dup = []
for num in nums:
if not(num in no_dup):
no_dup.append(num)
return no_dup
print remove_duplicates([1,1,2,2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment