Why does lambda is anonymous function???

5/29/2019 3:32:51 AM

Mukul Rajpoot

3 Answers

New Answer


It is called anonymous because you can call the function without storing it in the namespace. Example: power = (lambda x,y: x**y)(3,4) print(power) # Output: 81 But of course we could have stored the function in the namespace by giving it a name and then called it more than once. Example: pow = lambda x,y: x**y print(pow(2,5)) # Output: 32 print(pow(5,3)) # Output: 125 print(pow(7,2)) # Output: 49



For more refer to this lesson by sololearn : https://www.sololearn.com/learn/Python/2460/ Thanks