All problems
MediumFunctions
Closure — make a counter
Write `make_counter()` that returns a function which increments and returns a counter each call.
- #closures
- #nonlocal
Sample input
c = make_counter(); c(), c(), c()
Sample output
1 2 3
closure-counter.py
Output
Press "Run code" to execute.
