Given the example below, inspired by another from a SO Question:
x = 0
def func1():
x = 1
def func2():
x = 2
def func3():
KEYWORD x # scope declaration
x = 3
func3()
func2()
func1()
With global and nonlocal as KEYWORD, For x the values are respectively 0 and 2 instead of 3.
Does Python provides a mechanism to use the scope of func1() for x in func3()? Or only global, func2 and func3 scopes are accessible here?