Last active
December 24, 2015 02:59
-
-
Save matiasherranz/6734379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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