It's because anonymous functions like that are very much inspired by the lambda calculus where you'd write λx. f x for python's lambda x: f(x) and it's just a "pythonization" of that syntax.
I am curious, what is the meaning of lambda?
This is very good. will save it and look into.
from operator import mul as m
result = m(3, 4) print(result) # Output: 12
Loading collection data...
It's because anonymous functions like that are very much inspired by the lambda calculus where you'd write λx. f x for python's lambda x: f(x) and it's just a "pythonization" of that syntax.
I am curious, what is the meaning of lambda?
This is very good. will save it and look into.
from operator import mul as m
Example usage:
result = m(3, 4)
print(result) # Output: 12