The number of parameters in a general computer language cannot be changed, but the number of arguments in Python can be changed. This is achieved primarily through *arg and **arg in formal parameters, and the following rules must be observed with variable arguments:
1. Position parameter must appear before this *arg parameter
2, *arg must appear before **arg, after *arg this and **arg before the parameter must be the keyword parameter
3,**arg parameters can not have any parameters, in addition.
4, *arg after collecting positional parameters, the non-keyword parameter is a meta-ancestor, and **arg collects the keyword parameter as a dictionary.
def Testone (x,*xx,y=21,z=2, * *yy) :print(x,y,z,xx,yy)if__ name__= ='__main__': testone (1, 2,4, z=22, y=22, k1=0)
Results: 1 (2, 4) {' K1 ': 0, ' K2 ': 1}
Splitting of parameter lists
arg=[1,3,5]print(*arg)
Results: 1 3 5
Python variable list of parameters