18day
Function
1. Scope
In Python, a function is a scope. All local variables are placed in the current scope.
After the code definition is complete, the scope is generated, and the scope chain looks up
2. anonymous function
When a function needs to be used temporarily, it is no longer used after it is exhausted. An anonymous function (lambda) can be declared.
Lambda functions: Save code, and you can no longer need to define a function to use with other methods. such as map ()
3. High-order function
A variable can point to a function, which can receive a variable, and a function can receive another function function as a parameter, a function called a higher order function.
Satisfies any one of the following conditions, which is a higher order function
A, accept one or more functions as input
B, return returns another function
4. Recursive function
function to call the function itself again
Python Beginner 18th Day function (3)