Python Professional — Hard
Key points
- `nonlocal` keyword allows inner functions to modify variables from outer functions
- Each call to `f()` increments the value of `x`
- The output is 11, 12, 13
- The function `inner` is returned by `outer` and stored in `f`
Ready to go further?
Related questions
