Skip to content

Instantly share code, notes, and snippets.

@nyawach
Created March 11, 2020 08:49
Show Gist options
  • Save nyawach/541b28377dc439b888569673c48bebbd to your computer and use it in GitHub Desktop.
Save nyawach/541b28377dc439b888569673c48bebbd to your computer and use it in GitHub Desktop.
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