from functools import reduce
num_l = [2, 3 ,5]
def reduce_test(func, array, init =None):
if not init:
res = array.pop(0)
else:
res = init
for num in array:
res = func(res, num)
return res
print(reduce_test(lambda x, y: x*y, num_l, 100))
print(reduce(lambda x, y:x*y, num_l, 100))
D:\Python\Python36\python.exe D:/Python_test/day_lesson/test.py
3000
3000
Process finished with exit code 0