human
Give me a the Python program you requested given the following:
I am working on the file "Closure a dekorator.ipynb".
The first task is:
Pomocou closure napriklad takto
Can you write Python program for it?
assistant
#Here is the Python program you requested.

def A(x):
    def incr():
        nonlocal x
        x +=1
        return x
    return incr

obj = A(0)

obj()