Skip to content

Instantly share code, notes, and snippets.

@HirofumiYashima
Last active August 29, 2015 14:15
Show Gist options
  • Save HirofumiYashima/d51da8fa15a10e78daab to your computer and use it in GitHub Desktop.
Save HirofumiYashima/d51da8fa15a10e78daab to your computer and use it in GitHub Desktop.
Python で、None を含む リスト の要素の総和を求める方法 ref: http://qiita.com/HirofumiYashima/items/bafa1acc074b8f4a9236
filter(None, [1,2,3,None])
sum(filter(None, [1,2,3,None]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment