Reference: Http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/ 001431752945034eb82ac80a3e64b9bb4929b16eeed1eb9000
Example 1:
def F (a,b=1,*x,c=9,d,**y): ... Print ([a,b,x,y,c,d]) ...
Example 2:
def F (a,*, c,d): ... Print (a,c,d) ...
The order of the parameter definitions must be: required, default, variable, named keyword, and keyword parameters.
A: Positional parameters must be passed in
B: The default parameter can not be passed in, but it is different from the default value of other types
X: Variable parameters are not passed in, default () tuple type, can be passed in multiple, type can be different
*,c,d: The named keyword parameter must pass in, can set the default value, if there is a mutable parameter in front of it, can omit *, pass in the form "Variable name = value"
**y: keyword parameter is not passed in, default to {} dictionary type, can pass in multiple values, in x=1 format, (key value pair)
function parameters in Python