What this Python import question tests
This is a medium-difficulty Python question that probes your familiarity with the standard library and Python's runtime behaviour. It asks you to identify what module or object needs to be imported for a given code snippet to execute without errors in an interactive session.
Questions like this reward knowledge of Python's built-in modules, their common names, and the distinction between what is available by default versus what must be explicitly imported. They also test your ability to read error messages and reason backwards from expected behaviour to the necessary import statement.
- Standard library module discovery and naming
- Namespace and scope in Python
- Interactive REPL behaviour versus script execution