Open lesson

Mission: repair the two blank days

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Define nonoverlapping UTC days, recover the missing events, and be able to rerun exactly the same backfill.

Voss uses the report gap to claim the transfer happened twice. Imani needs a copy-based statement before the report is corrected. Mara gives you only three practice events: E7 at April 12 23:59 UTC, TRANSFER-7 at April 13 00:00 UTC, and E9 at April 13 09:00 UTC. The scene feels urgent, but this exercise has no real timer.

Your mission

  1. Write the complete April 12 UTC window using [start, end).
  2. State which day contains TRANSFER-7 exactly at midnight and why it is not counted twice.
  3. List the events for the 12th and 13th and the total without duplicates.
  4. Name four things to preserve so someone can repeat and check the backfill.

How to check your work

  • April 12 is [2026-04-12T00:00:00+00:00, 2026-04-13T00:00:00+00:00).
  • TRANSFER-7 belongs to April 13; the end of April 12 is excluded.
  • April 12 holds E7; April 13 holds TRANSFER-7 and E9; total 3.
  • Record the UTC bounds, source version, selection rule, and result.

Course example

from datetime import datetime

events = [
    ("E7", "2026-04-12T23:59:00+00:00"),
    ("TRANSFER-7", "2026-04-13T00:00:00+00:00"),
    ("E9", "2026-04-13T09:00:00+00:00"),
]

def in_window(start_text, end_text):
    start = datetime.fromisoformat(start_text)
    end = datetime.fromisoformat(end_text)
    if start.tzinfo is None or end.tzinfo is None or start >= end:
        raise ValueError("Use aware timestamps and start before end")
    return [
        event_id
        for event_id, time_text in events
        if start <= datetime.fromisoformat(time_text) < end
    ]

day_12 = in_window("2026-04-12T00:00:00+00:00", "2026-04-13T00:00:00+00:00")
day_13 = in_window("2026-04-13T00:00:00+00:00", "2026-04-14T00:00:00+00:00")
print(day_12)
print(day_13)
print(len(day_12) + len(day_13))

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with # are task reminders. Python ignores them. Write your code beneath them.

Python console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.py

Current editor source. Inspection shows your current edits.

# Write the complete April 12 UTC window using [start, end).
# State which day contains TRANSFER-7 exactly at midnight and why it is not counted twice.
# List the events for the 12th and 13th and the total without duplicates.
# Name four things to preserve so someone can repeat and check the backfill.

exemple.py

Declarative lesson asset; this is not a file created in the Python filesystem.

from datetime import datetime

events = [
    ("E7", "2026-04-12T23:59:00+00:00"),
    ("TRANSFER-7", "2026-04-13T00:00:00+00:00"),
    ("E9", "2026-04-13T09:00:00+00:00"),
]

def in_window(start_text, end_text):
    start = datetime.fromisoformat(start_text)
    end = datetime.fromisoformat(end_text)
    if start.tzinfo is None or end.tzinfo is None or start >= end:
        raise ValueError("Use aware timestamps and start before end")
    return [
        event_id
        for event_id, time_text in events
        if start <= datetime.fromisoformat(time_text) < end
    ]

day_12 = in_window("2026-04-12T00:00:00+00:00", "2026-04-13T00:00:00+00:00")
day_13 = in_window("2026-04-13T00:00:00+00:00", "2026-04-14T00:00:00+00:00")
print(day_12)
print(day_13)
print(len(day_12) + len(day_13))