{"height":"190","categories":["Python"],"published":"2009-08-01 00:00:00","author_url":"https://blog.hatena.ne.jp/mzp/","description":"fold\u306b\u4f3c\u305freduce\u304c\u3042\u308b\u306a\u3089\u3001unfold\u306b\u4f3c\u305f\u95a2\u6570\u304c\u3042\u3063\u3066\u3082\u3044\u3044\u3058\u3083\u306a\u3044\u3002 def unreduce(f,x): y = f(x) while y != None: yield y[0] y = f(y[1]) \u3053\u308c\u3067\u6574\u6570\u3092\u5404\u6841\u3054\u3068\u306b\u5206\u89e3\u3059\u308b\u30b3\u30fc\u30c9\u304c\u7c21\u5358\u306b\u66f8\u3051\u3061\u3083\u3046\u3088\u3002 base = 10 # 10\u9032\u6570\u306b\u3057\u305f\u3068\u304d\u306e\u5404\u6841\u306b\u5206\u89e3\u3059\u308b for x in unreduce(lambda m: None if m <= 0 else (m % base, m / base ) ,n): print x","blog_title":"\u307f\u305a\u3074\u30fc\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmzp.hatenadiary.org%2Fentry%2F20090801%2Funfold\" title=\"Python\u3067unfold - \u307f\u305a\u3074\u30fc\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://mzp.hatenadiary.org/","width":"100%","version":"1.0","provider_name":"Hatena Blog","image_url":null,"author_name":"mzp","type":"rich","provider_url":"https://hatena.blog","title":"Python\u3067unfold","url":"https://mzp.hatenadiary.org/entry/20090801/unfold"}