What goes in the blank?
# rebind a name from the enclosing function
def outer():
n = 0
def inner():
____ n
n += 1
Answer: nonlocal
nonlocal targets the enclosing function's variable, not a global one.
Play Problem Solving ▸