Lambda

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
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容