0003python中的可变参数

>>>def foo(x,y,z,*args,**kargs):

    print x

    print y

    print z

    print args  

    print kargs

>>> foo(1,2,3,4,5,name="qiwsir",age=37)

1 2 3 (4, 5) {'name': 'qiwsir','age':37}

posted @ 2017-02-05 18:28  紫色物语  阅读(189)  评论(0编辑  收藏  举报