No Do while/repeat until looping construct in python?

Lars W lw at
Thu Mar 13 05:24:24 CET 2003


	Why is there no do-while looping construct in Python? 
It seems to me that such a feature is very useful. Consider the 
following pseduocode:

while i<j:

Compared with an imaginary do-while loop like in C or Pascal:

	while i<j

Alternatively, the imaginary code could be written:

	until i>=j

<code> might be a large chunk of code which has to be run at
least once before the evaluation of "i<j" is made. But Python
forces you to write code on the first form. 

	I might be missing something, but do-while is indeed a
useful looping construct which users would benefit from using.

lw at

More information about the Python-list mailing list