参考 python3中的缺省参数和命名参数 - 云+社区 - 腾讯云
def test(a,b):
result=a+b
print("result=%d"%(a+b))
test(11,22)
test(11,1)
test(22,1)
def test1(a,b=1):#b=1 是一个缺省参数
result=a+b
print("result=%d"%(a+b))
test1(11)
test1(11,b=22) #此处b=22 是一个命名参数
参考 python3中的缺省参数和命名参数 - 云+社区 - 腾讯云
def test(a,b):
result=a+b
print("result=%d"%(a+b))
test(11,22)
test(11,1)
test(22,1)
def test1(a,b=1):#b=1 是一个缺省参数
result=a+b
print("result=%d"%(a+b))
test1(11)
test1(11,b=22) #此处b=22 是一个命名参数