Quick actions

cmd+k|ctrl+k

Navigation

Languages

Scope

Snippet info

Language

Python

Visibility

public

Author

shigeotoga

Created

2026-08-06T09:52:21.844481Z

Updated

2026-08-06T09:54:16.029774Z

total = 2

def count():
    global total
    # total = 0
    total += 1
    return total

print(total)
print(count())

def outer():
    x = "Local"
    
    def inner():
        # nonlocal x
        x = "Non local"
        print(f"Inner: {x}")
    inner()
    print(f"Outer: {x}")

outer()
INFO