A rental kiosk charges for every started minute. Its implementation follows that policy, but its docstring has not been updated. All durations supplied are nonnegative integers in seconds.
def billable_minutes(duration_seconds): """Return completed whole minutes, ignoring leftover seconds.""" return (duration_seconds + 59) // 60
For a session lasting 194 s, by how many minutes does the actual return value exceed the result described by the docstring? Answer in minutes as an exact integer.
Unlock full course notes by signing up
Document changes visible to the caller
A notification function receives an ordinary Python list of strings named tags and a string named tag. The current docstring omits details that callers need. Which statements accurately describe the shown function? Select all that apply.
Track units through a readable booking calculation
A booking program uses a unit-bearing identifier, a name that includes the measurement unit, for each monetary amount. Read the Python code and complete the table with the exact values stored after execution. Enter integers for amounts in cents and an exact decimal for the amount in dollars. The service fee applies once per booking.
Arrange a source file for predictable navigation
A team uses source-file organization, the arrangement of a file's sections, to help readers locate information. Arrange the Python blocks from top to bottom according to the team's documented layout:
The file description is the first statement, so Python recognizes it as the module's docstring.
Imports come before configuration constants.
Separate requirements from enforced checks
A delivery service accepts packages weighing 1–2000 g inclusive. Assume every supplied weight is an integer. A reviewer compares the function’s docstring with its implementation, including calls outside the permitted range. Which finding correctly identifies a documentation discrepancy?