What does the nonlocal keyword do in Python?
Correct answer
C. Refers to a variable in the nearest enclosing (non-global) scope
C. Refers to a variable in the nearest enclosing (non-global) scope
nonlocal lets a nested function rebind a variable of its enclosing function.
Asked in: Python Interview Functions
https://docs.python.org/3/tutorial/controlflow.html#defining-functionsNot sure why the answer is C? Ask here and get an explanation.