匿名函数

#匿名函数:一句话函数,比较简单的函数

# def func(a,b):
# return a+b

#构建匿名函数,lambda相当于def,关键字
# #,a,b相当于形参:,a+b 返回值
func1=lambda a,b: a+b
print(func1(4,4))

posted @ 2022-09-19 11:25  红丿领巾  阅读(24)  评论(0)    收藏  举报