What this Python language-knowledge question tests
This is a medium-difficulty question that probes your understanding of Python's runtime behaviour under CPython. Rather than testing algorithms or libraries, it asks you to read unfamiliar or tricky code and predict its output—a skill that matters when code review, debugging, and understanding legacy systems are part of the job.
To answer correctly, you'll need to reason about how Python evaluates expressions, manages scope, handles control flow, or applies language semantics that are easy to get wrong without hands-on experience. The question rewards careful attention to detail and familiarity with CPython's actual behaviour (rather than intuition from other languages).
- Variable scope and name resolution
- Expression evaluation order
- Mutable vs. immutable object semantics
- Control flow and short-circuit evaluation