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:
Each item below represents one complete block. Apply the stated team convention as well as the execution requirements.
1.
from datetime import date
2.
def display_summary(): print(REPORT_LABEL, date.today().isoformat())
3.
REPORT_LABEL = "Room reservations"
4.
"""Display today's room reservations."""
5.
if __name__ == "__main__": display_summary()
Unlock full course notes by signing up
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.
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.
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.
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?