Skip to content

Instantly share code, notes, and snippets.

@benhosmer
Created September 11, 2012 09:27
Show Gist options
  • Save benhosmer/3697188 to your computer and use it in GitHub Desktop.
Save benhosmer/3697188 to your computer and use it in GitHub Desktop.
Get the unique items from a python list using set()
mylist = ['apples', 'bananas', 'oranges', 'strawberries', 'apples']
print "Not Unique List: ", mylist
print "Unique List Using set: ", list(set(mylist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment