#lambda 没有名字的函数,特别简单的函数,只有return语句的函数 #语法 lambda 返回值 def hello(x): return x[1] print hello([1,2]) hello=lambda x:x[1] hello1=lambda x:x[0]+x[1] hello2=lambda x,y:x*y print hello([1,2]) print hello1([3,4]) print hello2(2,3)
python学习 匿名函数
原创
©著作权归作者所有:来自51CTO博客作者shouhou2581314的原创作品,谢绝转载,否则将追究法律责任
上一篇:python 函数应用
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
python查询汉字函数
python查询汉字函数
数据集 机器学习 特征提取 -
Python学习:匿名函数 lambda
python 使用 lambda 来创建匿名函数。
python 学习 开发语言 匿名函数 内置函数