Python函数式练习

def calc_prod(lst):
    def  prod():
        def mul_(a,b):
            return a*b
        return reduce(mul_,lst)
    return prod

f = calc_prod([1, 2, 3, 4])
print f()

posted on 2016-06-03 11:15  胖胖的乓乓  阅读(99)  评论(0编辑  收藏  举报

导航