loops — predict the output7 / 9
while, break, and the infinite loop ai ships
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.
Booting Python…
Output
[promptdojo:~]$ _