while, break, and the infinite loop AI ships — step 7 of 9
Cursor wrote a loop that should print every number from 1 to 6,
skipping 4. Instead, the loop stops dead at 4 and never prints 5
or 6. The wrong keyword is on line 3.
Fix it so the output is 1, 2, 3, 5, 6 — each on its own line.
The break is on line 3 — but read the whole snippet first.
⌘↵ runs the editor.read, then continue.
Cursor wrote a loop that should print every number from 1 to 6,
skipping 4. Instead, the loop stops dead at 4 and never prints 5
or 6. The wrong keyword is on line 3.
Fix it so the output is 1, 2, 3, 5, 6 — each on its own line.
The break is on line 3 — but read the whole snippet first.
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.