例子:
def test(x,y,z):
print(x,y,z)
def test1(x,y,z,*args):
print(x,y,z,args)
def test2(x,y,z,**kw):
print(x,y,z,kw)
a = [1,2,3]
y = {‘x’:1,’y’:2,’z’:3}
test(1,2,3)
test(z=1,x=3,y=2)
test(*a)
test(**y)
python中函数的参数理解
猜你喜欢
转载自blog.csdn.net/hh19900902/article/details/79142545
今日推荐
周排行