K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
from functools import reduce def add(x, y): return x + y lst = [1, 2, 3, 4, 5] res1 = list(map(lambda x: x * 2, filter(lambda x: x % 2 == 0, lst))) res2 = reduce(add, lst) print(res1, res2)