Quick actions

cmd+k|ctrl+k

Navigation

Languages

nonlocal variable

Snippet info

Language

Python

Visibility

public

Author

chanronny48

Created

2025-04-16T06:58:17.442217Z

Updated

2025-04-16T07:00:17.347544Z

#a=10
def b():
    def c():
        nonlocal b
        b=10
        print(b)
    global a
    b=1
    a=2
    print(a)
    c()
b()
print(a)
INFO