Python function learning, python Function
Functional Programming
1. Simplified code,
2. Convenient calling and convenient Modification
3. Call parameters, shape parameters, and location parameters. Key parameter. The location parameter can only be sent after the key parameter.
4. Default Parameters
5. parameter group (* args) tuples
6. When using the dictionary (** kwargs) at the same time, it must be placed at the end of the parameter.
Running the program from top to bottom of the file
Local variable
A variable takes effect only in the function. External access failed
Global Variables
For variables declared at the top level of the file, you can use the keyword global name to modify global variables.
We do not recommend that you use global when using it. You cannot modify global variables in the function. Otherwise, debugging is not good.
Recursive functions
1. There must be a clear termination condition
2. Each time you enter a deeper layer of recursion, the problem scale should be reduced compared to the previous recursion.
3. Too many recursive layers may cause stack overflow.