Question 1
Topic: Modules and Packages
Skill tested: Resolves nested package imports using package-qualified names and import search paths.
A data-processing application has this layout: `app.py`, `analytics/__init__.py`, `analytics/reports/__init__.py`, and `analytics/reports/summary.py`. The `summary.py` module defines `build()`. The application is launched with its working directory set to the directory containing `app.py`. A developer wants `app.py` to call `build()` without modifying `sys.path` or relying on the process working directory beyond this launch arrangement. Which import statement is the most appropriate?
The directory containing the launched top-level script is placed on the module search path, so `analytics` can be imported as a top-level package. The fully qualified import follows the directory/package nesting and binds the `summary` module for the subsequent call. Importing `summary` alone does not find it at the top level, and reversing the package order does not match the layout. A leading-dot relative import is intended for use from within a package module; `app.py` is the top-level script here.