$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #209

What goes in the blank?

# rebind a name from the enclosing function
def outer():
    n = 0
    def inner():
        ____ n
        n += 1

Answer: nonlocal (also accepted: nonlocal, nonlocal())

nonlocal targets the enclosing function's variable, not a global one.
Play Problem Solving ▸