如下所示:

# 求一个列表中所有元素的乘积

from functools import reduce

lt = [1,2,3,4,5]

ln = reduce(lambda x,y:x * y,lt)

print(ln)