Python 中 参数* 和 **

举个例子就知道了

class test():

    def __init__(self, *a, **b):
        print(a)
        print(b)
        print(b.get('test'))


tester = test(1, 2, 3, test='abc')

输出如下

(1, 2, 3)
{'test': 'abc'}
abc

Process finished with exit code 0

原文地址:https://www.cnblogs.com/WalkOnMars/p/12011094.html