Type of parameter:
There are 2 types of parameters for a function:
1. function definition is used to receive the form parameter parameters of the value.
2. The actual parameter arguments used to pass the value when the function is called.
Parameters are passed:
There are 2 ways of delivery:
1. Value passing: Copies the value of an argument to a parameter, regardless of whether the value is the original value, the pointer value, or the heap object value.
2. Reference passing: References the same object to the shape participation argument.
There are 2 forms of delivery:
1. Pass by Position:
2. Pass by name:
Definition of formal parameters:
The formal parameters of a function can be divided into:
1. General parameters
2. Default parameters: Parameters with default values
3. Variable-length parameters: According to the transfer parameter transfer form is divided into
(1) Variable length position parameter, receive using *seq object.
(2) variable length named parameter, received using **dict object.
The default parameter must be after the normal parameter
The variable length parameter must be after the default parameter
Variable-length named arguments must be after the variable-length position parameter
Python: summary of function parameters