No Do while/repeat until looping construct in python?

lynx none at of.your.business
Fri Mar 14 20:41:53 CET 2003


On Fri, 14 Mar 2003 00:45:42 +0000, Steven Taschuk wrote:

[...]
> But they're not equivalent, logical massage or no.
> 	while not clean
> 		rinse
> 		lather
> doesn't rinse and lather if already clean, while
> 	repeat
> 		rinse
> 		lather
> 	until clean
> rinses and lathers at least once in all cases.

i phrased that poorly. the insight i meant to talk about was that the two
can be made effectively equivalent, through rewriting the conditional as
appropriate; the one exception would be when you don't want the loop to
run at all, in which case no amount of rewriting the conditional will make
a postcondition loop work for you - but if *that's* the case, most likely
you can just remove the loop entirely.

-- 
   PGP/GnuPG key (ID 1024D/3AC87BD1) available from keyservers everywhere
    Key fingerprint = FA8D 5EA4 E7DC 84B3 64BC  410C 7AEE 54CD 3AC8 7BD1
                "...if you can fill the unforgiving minute
                with sixty seconds' worth of distance run..."





More information about the Python-list mailing list