中国人在俄罗斯做网站需要多少卢布,济南快速网站排名,电子商务网站业务流程图,重要的网站建设文章目录 1 函数多返回值2 函数多种传参方式2.1 位置参数2.2 关键字参数2.3 缺省参数2.4 不定长参数 3 匿名函数函数作为参数传递lambda匿名函数 1 函数多返回值 def test_return():return 1,2,3
x,y,z test_return()
print(x)
print(y)
print(z)2 函数多种传参方式 2.1 位置参… 文章目录 1 函数多返回值2 函数多种传参方式2.1 位置参数2.2 关键字参数2.3 缺省参数2.4 不定长参数 3 匿名函数函数作为参数传递lambda匿名函数 1 函数多返回值 def test_return():return 1,2,3
x,y,z test_return()
print(x)
print(y)
print(z)2 函数多种传参方式 2.1 位置参数 2.2 关键字参数 def user_info(name,age,gender):print(name,age,gender)
user_info(小明,18,男)
user_info(name小王,age18,gender男)
user_info(age18,gender女,name小白)
user_info(天天,age48,gender男)2.3 缺省参数 def user_info(name,age,gender男):print(name,age,gender)
user_info(小天,13)
user_info(x,55,女)2.4 不定长参数 def user_info(*args):print(args)
user_info(1,2,3,xiaom)def user_info(**kwargs):print(kwargs)
user_info(name小王,age18,gender男)3 匿名函数
函数作为参数传递 def test_func(compute):result compute(1,2)print(type(compute))print(result)
def compute(x,y):return xy
test_func(compute)lambda匿名函数 def test_func(compute):result compute(1,2)print(result)
test_func(lambda x,y:xy)