Question: What is the purpose of the nonlocal keyword in Python?
Answer: The nonlocal keyword is used in nested functions to indicate that a variable refers to a previously bound variable in the nearest enclosing scope that is not global, allowing the variable to be modified.