What this Python language-feature interview question tests
This is a medium-difficulty Python question that probes your understanding of language semantics and how modern Python versions handle specific constructs. It requires you to trace through code execution carefully and predict output with confidence—a skill that matters in roles where you read and debug others' code quickly.
To answer questions like this, you need to know not just what a feature does, but how it behaves in edge cases and what changed between versions. The question specifies Python 3.5 or later, which is a hint that version-specific behaviour matters. Candidates should be able to run through the code mentally, track state changes, and reason about language rules without guessing.
- Version-specific syntax and semantics
- Operator precedence and evaluation order
- Type coercion and truthiness rules
- Built-in function behaviour