I. Namespaces and Scopes
Name Space classification:
Built-in namespaces
Import this
Dir (buil-in) View all built-in
Global namespaces
Local name space
Within the function body, etc.
Querying Global and Local
The Globals () method can get global content
The global content that the method obtains is the global content that was previously defined by the program when it was called
The locals () method can get local content
Two. Function nesting
function nested call
Other functions are called inside the function
Nested Definitions of functions
Define other functions inside a function
Three. Function object and Closure
A function is the first class of objects
Functions can be assigned values
Pass the function as a parameter
Take a function as a return value
Use the function as an element of the container type.
Definition of closures:
Defined to internal functions include the use of external scopes, but not the use of global scopes
Return value for the closure pack
Features: self-taking parameters
python\ function 2