python - function 9, the use of variable length parameters

def foo(*args,**kwargs):
    print(args)
    print(kwargs)
foo( 1,21,111,22,11,x=1,y=2,z=3 # todo can receive parameters of any form and length 
# todo must be ** after because the keyword must be after
View Code

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324655628&siteId=291194637