The first 23 anonymous function scope python learning function is programmed document processing

Scope:

name = "Test" 
DEF Test ():
name = "Test"
DEF test1 ():
name = "test1"
Print (name)
return test1

A = Test () # reception value test1 return the return value, but test1 is a function so is the address of the function name, the address of the function assigned to a
Print (a) # test1 output memory address of
a () # a plus to get the address of the content () function to run inside

() output looks #a is global variables, but in the previously defined plane test1 function

test () () # ------> represents a direct call to the inside of the second function test

NOTE: If more than one test may be nested function definitions () ( )()use


Guess you like

Origin www.cnblogs.com/jianchixuexu/p/11521577.html