+ 4
What is lambda in Python
4 ответов
+ 3
lambda is a small anonymous function that can take any number of arguments, but can only have one expression.
sum = lambda num : num + 10
+ 1
Lambda is a python anonymous one-line function;
#basic function
#syntax:
def f_name(args):
<some process>
return value
#eg.
def add(x, y):
return x+y
#lambda function
#syntax
f_name = (lambda args : value)
#eg.
add = (lambda x,y: x+y)
+ 1
name<f>