# a = [1,2,3,4,5,6,7,8]
# result = filter(lambda x:x>3,a)
# for x in result:
# print(x)
# a = [1,2,3,4,5,6,7,8]
# result = map(lambda x:x*10,a)
# # for x in result:
# # print(x)
# print(list(result))
from functools import reduce
a = [1,2,3,4,5,6,7,8]
result = reduce(lambda x,y:x+y,a)
print(result)
转载出处:知了课堂黄勇老师笔记