Python Semantics 0/125

Submodule 4 of 15

Scope & Namespaces

Local, enclosing, global, built-in.

0/9 solved
Question Tags Difficulty Success
1. LEGB Lookup Skips to Enclosing
legbscope +1
Medium 92%
2. Global Statement Needed Only to Assign
global-statementscope +1
Medium 50%
3. Nonlocal Counter Closures
nonlocalclosures +1
Medium 57%
4. Assignment Anywhere Makes It Local
unboundlocalerrorscope +1
Medium 40%
5. Shadowing a Builtin Two Ways
shadowingbuiltins +2
Hard 42%
6. Comprehension Variable Versus For Loop Variable
comprehension-scopefor-loop +1
Hard 60%
7. Scope Rules Select All That Apply
global-statementnonlocal +2
Hard 23%
8. Walrus Leaks, Loop Variable Does Not
walrus-operatorcomprehension-scope +1
Hard 69%
9. Walrus Target Lands in the Function, Not Global
walrus-operatorcomprehension-scope +1
Hard 67%

Up next

9 of 9 questions here are still unsolved.

Next submodule Default Arguments