• for-loop

The asker is surprised that their for loop containing a return statement exits after one iteration. This may be due to an indentation error, or a misunderstanding of what return does. The asker may be interested in using yield.