Python parameters * and **

For example know

class test():

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


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

 

Output follows

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

Process finished with exit code 0

Guess you like

Origin www.cnblogs.com/WalkOnMars/p/12011094.html