Created
March 11, 2020 08:49
-
-
Save nyawach/541b28377dc439b888569673c48bebbd to your computer and use it in GitHub Desktop.
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 uniq(items: list): | |
''' | |
元の順序を保持したままuniqにする | |
''' | |
return sorted(set(items), key=items.index) | |
def not_none_items(items: list): | |
''' | |
Noneなアイテムを除外する | |
''' | |
return [item for item in items if item] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment