综合吧
Topic source# -*- coding: utf-8 -*-
from functools import reduce
def prod(L):
def mul(x,y):
return x*y
print ('3 * 5 * 7 * 9 =', reduce(mul,L))
- 1
# -*- coding: utf-8 -*-
from functools import reduce
def prod(L):
def mul(x,y):
return x*y
print ('3 * 5 * 7 * 9 =', reduce(mul,L))
冲天魔王
print(reduce(getji,list(map(abs, [-1,-2,3,-4]))))