Lamda, which is often used as inline function is a single expression anonymous function. We generally use it like this:
A lambda form in python does not have statements as it is used to make new function object and then return them at runtime.
lambda arg1 arg2 ... : <expression using args>
For eg.
9
A lambda form in python does not have statements as it is used to make new function object and then return them at runtime.
lambda arg1 arg2 ... : <expression using args>
For eg.
>>> triangle_perimeter = lambda a,b,c:a+b+c
>>> triangle_perimeter(3,3,3)
9
No comments :
Post a Comment