An inner function executes count += 1, but count is bound only in the enclosing function.…

from Closures
Python 3.14 intermediate 1 min

An inner function executes count += 1, but count is bound only in the enclosing function. What happens without nonlocal count?

Report an error