scope04.py

# ===================================================================
#
# ===================================================================

x = 'Main X Value'

def FuncA():

    x = 'FuncA X Value'

    def FuncAA():

        global x

        print('in FuncAA x = {}'.format(x))

    FuncAA()

    print('in FuncA  x = {}'.format(x))

# -------------------------------------------------------------------
# main
# -------------------------------------------------------------------

FuncA()

print('in main   x = {}'.format(x))