day11 finishing

day11 finishing

Vararg

* Name parameter tuple received extra argument position

When you call the function, the number of position argument, it receives the number of

** Katachisan

Receiving excess keyword arguments dictionary

*Arguments

* Lt break the list into a position of elements sequentially passed argument position parameter

** Arguments

** dic broken into the dictionary and keyword arguments passed to the function

Function object

  1. Quote
  2. Container element
  3. As the argument of function
  4. As the return value of the function

== function object function name

Nested functions

Function which has the function

Internal function defined functions, can not be used outside

Function namespace

Namespace: special storage name

Built-in namespace: stores the name of the built-in method

Data type own built-in method

Global namespace: remove the built-in global and local call

Namespace generates order summary:

  1. Built-in namespace
  2. Global name space
  3. The local name space

Search elements order:

Start looking for the current location, and then can not find in that order, not looking backward

Local ---> Global -----> Built

Scope

Global scope: built-in namespace + global name space

The local scope: local name space

global: let the global become local variables

nonlocal: Let the local variables become the top-level function

All variable data types can break all the rules above

Guess you like

Origin www.cnblogs.com/kaizi111/p/11568064.html