1#max num in list
2from functools import reduce
3items = [1, 24, 17, 14, 9, 32, 2]
4all_max = reduce(lambda a,b: a if (a > b) else b, items)
5
6print (all_max) # 32
1from functools import reduce
2items = [1,2,3,4,5]
3sum_all = reduce(lambda x,y: x + y, items)
4
5print (sum_all) #15