python access variable from nested function code example
Example: python nested functions get variables from function scope
def a():
val = True
def b():
nonlocal val
val = False
def a():
val = True
def b():
nonlocal val
val = False