What this Python tuple and unpacking question tests
This is a medium-difficulty language-knowledge question that probes your understanding of how Python handles tuple construction, unpacking, and the subtle edge cases that arise from operator precedence and syntax rules. It's the kind of question that separates candidates who have read the language specification from those who have only skimmed tutorials.
To answer correctly, you need to reason carefully about what the code actually does—not what you might expect it to do. This often hinges on understanding the difference between a tuple literal, a function call, and the comma operator in Python. The question rewards precision in reading syntax and knowing the exact semantics of tuple behaviour in context.
- Tuple literal syntax and the role of the comma
- Operator precedence in Python expressions
- Unpacking and implicit tuple creation
- How print() interprets its arguments