What is a closure in Python?
Correct answer
B. A function that remembers variables from its enclosing scope
5 views
B. A function that remembers variables from its enclosing scope
5 views
A closure retains access to variables of the enclosing function even after it has returned.
Asked in: Python Interview Functions
https://docs.python.org/3/tutorial/controlflow.html#defining-functionsNot sure why the answer is B? Ask here and get an explanation.