Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
リストで重複除く
list_a = ["a","a","a","a","b","b","c","d","d","d"]
print "before: %s" % list_a
print "after: %s" % list(set(list_a))
before: ['a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'd', 'd']
after: ['a', 'c', 'b', 'd']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.