Answers

Question and Answer:

  Home  Python

⟩ What are uses of lambda?

It used to create small anonymous functions at run time. Like e.g.

def fun1(x):

return x**2

print fun1(2)

it gives you answer 4

the same thing can be done using

sq=lambda x: x**2

print sq(2)

it gives the answer 4

 231 views

More Questions for you: