Created
September 24, 2013 15:41
-
-
Save mudgen/6686717 to your computer and use it in GitHub Desktop.
Unique List
This file contains hidden or 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
| def unique(items): | |
| found = set() | |
| keep = [] | |
| for item in items: | |
| if item not in found: | |
| found.add(item) | |
| keep.append(item) | |
| return keep | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment