标签:使用 匿名函数 func ret python pytho 代码 UNC 常用模块
###匿名函数与内置函数
‘‘‘
匿名函数与内置函数
常用模块
面向对象
‘‘‘
‘‘‘
def func(x,y,z=1):
return x+y+z
# print(func)
# print(func(1,2,3))
#匿名函数:1、没有名字 2:函数体自带return
#函数体只有一行代码可以这样写
‘‘‘
lambda x,y,z = 1:x+y+z
‘‘‘
实际上就是:
lamdba x,y,z = 1:
return x+y+z
‘‘‘
zzz = lambda x,y,z = 1:x+y+z
print(zzz)
#匿名函数的应用场景:
#应用于一次性的场景,临时使用
‘‘‘
#内置函数
‘‘‘
标签:使用 匿名函数 func ret python pytho 代码 UNC 常用模块
原文地址:https://www.cnblogs.com/Albert-w/p/10996818.html