+ 1
When do we use lambda function usually??
What is use actually
1 ответ
0
Rather than making a separate (simple) function that you only need to use once... then you'd use a lambda.
example:-
def myfunct(a, b):
return a + b
## this uses the function above
print(list(map(myfunct, (10, 20, 30), (10, 20, 30))))
## this uses a lambda
print(list(map(lambda a, b: a + b, (10, 20, 30), (10, 20, 30))))