Python2 default to Unicode required before string plus u
Cycle through each line
Loop print the entire file content way two
Take one line at the same time below
First define and then execute
When a function is defined, only syntax errors are detected and not executed
function return value, default is tuple mode
Return can only be returned once
form participates in the actual parameter
Formal parameters are variable names
Arguments are values
Breaking the order limit
Frequently changing values are used with positional parameters, and the values are usually constant with the default arguments.
Default parameters are usually defined as immutable types.
The default parameter is assigned only once when it is defined.
Variable length parameter is *
Keyword parameter (keyword parameter refers to the specified y=2,z=3 in the argument, etc.)
* Equivalent to positional parameters
function inner nested function
Incorrect version
Correct version
Named keyword parameters
Must pass value, must be in the form of a keyword
Writing order
Namespaces and Scopes
The assignment of the function takes precedence from the local namespace, then goes to the global namespace lookup, and finally to the built-in namespace lookup
namespaces, first local, global, built-in
The scope, the priority from the current position to find, and then go to another place to find
Function object
Python Learning notes section fifth (functions, namespaces, scopes)