promptdojo_

Diagnose any crash in one read — step 7 of 9

Claude wrote this loop and the last iteration crashes with IndexError: list index out of range. The off-by-one is on line 3 — range(len(words) + 1) walks one past the end of the list.

Fix the off-by-one so the script prints each word, one per line, with no crash. Expected output:

hello
world
fine
The break is on line 3 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.