and returns the value of a single expression. lambda functions can not contain commands, and
they can not contain more than one expression.
there are no parentheses around the argument list, and the return keyword is missing (it is implied, since the entire function can only be one expression).
>>>(lambda x: x*2)(3)
6
an other interesting lambda
Thanks for sharing.
回覆刪除Python Online Training
Data Science Online Training