loops — predict the output9 / 9
while, break, and the infinite loop ai ships
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Last one. Cursor wrote a "find the first match" loop that walks through a
list of usernames and stops as soon as it finds one starting with "a".
Two things are broken: the loop variable never advances (so it'll loop
forever on the first name), and the break is missing — even if the loop
did advance, it would scan past the first match.
Fix both bugs so the script prints found: alex.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _