🐍PyQuiz
Which of these are NOT objects in Python?
Which of these are NOT objects in Python?
Anonymous Quiz
16%
Functions
11%
Classes
34%
Modules
39%
None
Closures: Functions That Remember
Closures can be mystifying. Imagine a function inside another function, and the inner function remembers the outer function’s variables, even after the outer function has finished running.
Closures capture variables by reference, which is why beginners often stumble when using loops inside closures. They’re powerful once you understand that the inner function “remembers” its environment.
Closures can be mystifying. Imagine a function inside another function, and the inner function remembers the outer function’s variables, even after the outer function has finished running.
Closures capture variables by reference, which is why beginners often stumble when using loops inside closures. They’re powerful once you understand that the inner function “remembers” its environment.
❤2
🐍 PyQuiz
A Python function with no return statement actually returns:
A Python function with no return statement actually returns:
Anonymous Quiz
15%
0
21%
False
35%
None
29%
Nothing
🐍 PyQuiz
If Python can't find a variable locally, what's the next place it looks?
If Python can't find a variable locally, what's the next place it looks?
Anonymous Quiz
52%
Global
21%
Built-in
22%
Parent scope
6%
None
👏1