1li = [5, 7, 22, 97, 54, 62, 77, 23, 73, 61]
2
3final_list = list(map(lambda x: x*2, li))
4print(final_list)
1# Map function
2
3nums1 = [2,3,5,6,76,4,3,2]
4sq = list(map(lambda a : a*a, nums1))
5print(sq)
1#Reduce function
2
3from functools import reduce
4list2 =[1,2,3,4,5]
5fins = reduce(lambda x,y:x+y, list2)
6print(fins)
7
8#o/p : 15
9
10# reduce similar to this concept
11list2 =[1,2,3,4,5]
12adds = 0
13for i in list2:
14 adds+=i
15print(adds)
16