Measure the effect of an outdated docstring

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.


Python
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.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Program Readability, Organization, and Documentation Questions: