make_counter(start=0) that returns a new function increment(step=1). Each call to the returned increment function should add step to an internal counter (initialized to start) and return the new counter value. The counter state must persist between calls via a closure, not a global variable.c = make_counter() c() c() c(5)
1, 2, 7
First two calls default step=1 (1, then 2), third call adds 5 (7).
Use the nonlocal keyword inside the inner function to modify the outer variable.
The outer function defines the state variable; the inner function closes over it and is returned.