+ 2

Why does lambda is anonymous function???

29th May 2019, 3:32 AM
Mukul Rajpoot
Mukul Rajpoot - avatar
3 Réponses
+ 5
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
29th May 2019, 3:43 AM
Eduardo Petry
Eduardo Petry - avatar
+ 3
Thnx
29th May 2019, 3:52 AM
Mukul Rajpoot
Mukul Rajpoot - avatar
+ 1
For more refer to this lesson by sololearn : https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2460/ Thanks
29th May 2019, 3:49 AM
Prince PS[Not_Active]
Prince PS[Not_Active] - avatar