Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 11)
11.
What is the purpose of the nonlocal keyword?
Declares a local variable
Specifies the scope of a function
Converts a global variable to a local variable
Refers to a variable in the nearest enclosing scope
Answer: Option
Explanation:
The nonlocal keyword is used to indicate that a variable refers to the nearest enclosing scope that is not global.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.