Because it's logical.
"
What is logical?
"
To put the exit condition at the bottom is logical.
The exit condition glues the loop to the code that will be executed next
which is also at the bottom.
Example:
Loop
NextCode
^
Placing the exit ondition near next code makes more sense at least in
situation where I was programming.
I will give you an example:
LoopBegin( Step = 10 )
if ButtonExists then
begin
ClickButton()
end;
LoopEnd( ButtonClicked )
Execute next code...
This loop waits for the button to appear, once it's found it is clicked and
then the loop exits to continue the next code.
Putting this exit condition on the top makes no sense.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list