Skip to content

Instantly share code, notes, and snippets.

@matiasherranz
Last active December 24, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matiasherranz/6734379 to your computer and use it in GitHub Desktop.
Save matiasherranz/6734379 to your computer and use it in GitHub Desktop.
# Let's create a list with duplicated elements:
ls = [1,1,1,2,2,1,5,4,3,2,1]
# And let's now remove them in just one line:
l2 = list(set(ls))
# See the result:
print l2
[1, 2, 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment