Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Closures
What does a Python closure capture for a free variable?
from Closures
Python 3.14
intermediate
1 min
What does a Python closure capture for a free variable?
The variable binding, whose current object is looked up when the closure runs
An immutable copy of the value at function creation time
The entire local namespace of every caller
Check
Ask AI about this kata
Report an error
next kata
An inner function executes count += 1, but count is bound only in the enclosing function.…
Quiz
A new version is available
Reload