Advanced Python syntax - MRO related -args multiple inheritance and kwargs (4.5.2)

@

1. Description

args tuple data type
kwargs dictionary data type is
generally passed to the method used to traverse to get the value of
the order of arguments passed no special requirements
When your custom parameters through after he wrote the name gave kwargs, no to name args

2. Code


def test(*args,**kwargs):
    for i in args:
        print(i)


    for i in kwargs:
        print(kwargs[i])


if __name__ == '__main__':
    test(1,2,3,3,4,4,12,4,12,4,name="adada",hhehe="dadad")

About the Author

Personal blog site
personal GitHub address
individual public number:
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/simon-idea/p/11411781.html