Number of Scopes : nested function « Function « Python Tutorial






def foo():
    m = 3
    def bar():
        n = 4
        print m + n
    print m
    bar()
foo()
foo()








10.12.nested function
10.12.1.Number of Scopes
10.12.2.Simple Closure Example
10.12.3.Scope and lambda
10.12.4.Nested functions.