Practice worksheet — teaching exercise, no fabricated results Diagnose a small coding error with AI assistance Diagnose a Python list indexing error through a reproducible report, minimal fix and boundary tests. 1. A symptom is not the cause Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: Why does numbers[3] fail for a three-element Python list? Reference answer (try before reading): Python indexes from zero, so positions are 0, 1 and 2; position 3 does not exist. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 2. Give the assistant a reproducible description Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: Why include the intended result and error in an AI debugging request? Reference answer (try before reading): So the suggestion addresses the actual mismatch rather than inventing unrelated changes. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 3. Test the boundary case Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: What happens when numbers[-1] is used on an empty list? Reference answer (try before reading): It also raises an error; guard the empty case if it is a supported input. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 4. Demand an explanation of the change Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: Why not silence the issue with a broad try/except? Reference answer (try before reading): It may hide symptoms without repairing the cause. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 5. Keep a reproducible fix record Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: What belongs in a reusable debugging record? Reference answer (try before reading): Symptom, cause, minimal fix, ordinary test and edge-case test. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ Final project: input A program accesses a nonexistent index when printing the last item Reference deliverable Before: numbers=[2,4,6]; print(numbers[3]) raises IndexError. After: print(numbers[-1]) returns 6 for a nonempty list. For numbers=[], check if numbers first and print an empty-list message. Acceptance criteria Tests: [2,4,6]→6, [9]→9, []→clear message; do not merely hide the original exception. Note: do not invent a test result or enter sensitive data in examples.