Function-Type programming
1. Simplify the code,
2, easy to call, easy to modify
3. Call parameters, shape parameters, and positional parameters. Key parameters, position parameters can only be sent after the key parameters
4. Default parameters
5. Parameter group (*ARGS) tuple parameter
6 Accept Dictionary (**kwargs) when used simultaneously must be placed at the end of the parameter
Run the program from top to bottom of the file
Local variables
A variable takes effect only in the function. External access is not available
Global variables
Variables declared at the top level of the file, local variables can be modified global variables need to use the keyword global name
Global variables cannot be modified in the function when used, otherwise it is not good to debug
Recursive functions
1. There must be a clear end condition
2. Each time a deeper level of recursion is reached, the problem size should be reduced compared to the previous recursion
3. Recursive efficiency is not high, too many recursive levels will lead to stack overflow
Python function Learning