function naming rules:
As with variables, refer to the official recommended naming format for Python: function_name. lowercase + underline
Required parameters: Arguments must be passed and can be assigned at call time.
Default parameter: parameter can be passed. Does not pass the parameter, is the default value, passes the parameter to overwrite. The name of the parameter is the same! (Example: Step is a default parameter)
Optional parameters: The brackets are indicated. (e.g. before: [, stop] is optional)
The parameter passed in is a tuple, and no incoming parameter is an empty tuple.
Keyword parameter: When defined, it looks the same as the required parameter. When you invoke a function by using the keyword argument, the order of the arguments can be different from the declaration, and the Python interpreter can match the parameter values with the argument names.
Indefinite Item parameter:
Fun (*args), asterisk * must have, args is the convention idiomatic, generally written *args. Whatever you want, you can pass anything.
If you pass in a list, dictionary ... are packaged into tuples as elements of a tuple.
Fun (*[1,2]) Add a *, is the inside of the shell removed, unpacking. (+)
Fun (*{1,2}), {1,} dictionary, only the key is left.
Fun (**kwargs) Example: Fun (A=1, b=2), {"A": 1, "B": 2}. Packaged into a dictionary. To follow the rules of variable naming!
This situation: Fun (**{' a ': 1}), {' A ': 1} keyword must be a character type, or an error.
Python basic functions