Lambda functions aren’t as powerful as named functions.
They can only do things that require a single expression – usually equivalent to a single line of code.
named function
def polynomial(x):
return x**2 + 5*x + 4
print(polynomial(-4))
lambda
print((lambda x: x**2 + 5*x + 4) (-4))
0
0
原文链接:Lambda
© 版权声明
THE END
暂无评论内容