{"published":"2017-03-08 00:07:31","provider_name":"Hatena Blog","width":"100%","description":"functools\u306ereduce\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001\u30ea\u30b9\u30c8\u306e\u4e2d\u8eab\u3092\u5168\u3066\u8db3\u3057\u305f\u308a\u639b\u3051\u305f\u308a\u3001\u3068\u3044\u3063\u305f\u64cd\u4f5c\u3092\u884c\u3048\u307e\u3059\u3002 from functools import reduce from operator import add, mul a = [1, 2, 3, 4] # \u9069\u5f53\u306a\u30ea\u30b9\u30c8 reduce(add, a) # \u7dcf\u548c > 10 reduce(mul, a) # \u7dcf\u4e57 > 24 \u3053\u3093\u306a\u611f\u3058\u3002 \u3061\u306a\u307f\u306b reduce(add, a)\u306f reduce(lambda x, y: x+y, a) reduce(mul, a)\u306f reduce(lambda x, y: x*y, a) \u3068\u540c\u5024\u3067\u3059\u3002 redu\u2026","type":"rich","blog_url":"https://inarizuuuushi.hatenablog.com/","height":"190","provider_url":"https://hatena.blog","author_name":"inarizuuuushi","version":"1.0","image_url":null,"title":"Python  reduce\u95a2\u6570","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finarizuuuushi.hatenablog.com%2Fentry%2F2017%2F03%2F08%2F000731\" title=\"Python  reduce\u95a2\u6570 - Sabrou-mal \u30b5\u30d6\u30ed\u30a6\u4e38\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"Sabrou-mal \u30b5\u30d6\u30ed\u30a6\u4e38","categories":[" python "],"author_url":"https://blog.hatena.ne.jp/inarizuuuushi/","url":"https://inarizuuuushi.hatenablog.com/entry/2017/03/08/000731"}