Scope and lambda : nested function « Function « Python Tutorial






x = 10
def foo():
    y = 5
    bar = lambda :x+y
    print bar()
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.