Use of lambda function in Python

Use of lambda function in Python

Instructor-svgAl-Mamun Sarkar
Mar 25 , 2020

Use of lambda function in the python programming language.

sum_number = lambda a, b: a + b
print(sum_number(50, 12))
print((lambda a, b: a + b)(12, 12))


def my_function(func, arg1, arg2):
    return func(arg1, arg2)


print(my_function(lambda a, b: a + b, 10, 20))

 

Output:

62
24
30

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram