def outer(): x = "John" def inner(): nonlocal x x = "hello" inner() return x