+1 vote
in Python by (30.7k points)
What do you understand by lambda function? Create a lambda function

1 Answer

0 votes
by (30.7k points)

To Create a lambda function which will print the sum of all the elements in this list -> [5, 8, 10, 20, 50, 100]

from functools import reduce

sequences = [5, 8, 10, 20, 50, 100]

sum = reduce (lambda x, y: x+y, sequences)

print(sum)

Click here to read more about Python
Click here to read more about Insurance

Related questions

+1 vote
0 votes
+1 vote
asked Feb 14, 2021 in Python by SakshiSharma (30.7k points)
+1 vote
asked Feb 15, 2021 in Python by SakshiSharma (30.7k points)
...