Skip to content

Instantly share code, notes, and snippets.

@jonathanpike
Last active August 29, 2015 14:23
Show Gist options
  • Save jonathanpike/c606517c340a08d3d937 to your computer and use it in GitHub Desktop.
Save jonathanpike/c606517c340a08d3d937 to your computer and use it in GitHub Desktop.
# from http://www.practicepython.org/exercise/2014/05/15/14-list-remove-duplicates.html
def removedupes(list):
new_list = []
for i in list:
if i not in new_list:
new_list.append(i)
else:
pass
print new_list
test = [1, 1, 2, 3, 5, 5, 5, 6, 7, 8, 8, 9]
removedupes(test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment