human
I am working on the file "Python/Scope.ipynb".
The first task is:
如果是多层嵌套怎么办？
Can you write Python program for it?

Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

def out4():
    i, j = 1, 2
    def middle():
        i, j = 3, 4
        def inner():
            nonlocal i, j
            i, j = 5, 6
        inner()
        print(i, j)
    middle()
    print(i, j)
    
out4()