Sometimes, when writing code, I find it would be nice if there were a "do...until" construct in Python. This would be preferable to using a "while" construct if you wanted to make sure the loop will execute at least once. You CAN do this with a "while" construct, but it requires fiddling with the loop condition before the "while" construct, which is "messy". An example: condition = TRUE # make sure loop runs at least once while (condition): # do some stuff # do some more stuff condition = whatever_stops_the _loop Here is my question-- If Python WERE to have a "do...until" construct, what would be the best way to implement the syntactical rules? For example: do: # some stuff # some more stuff until (condition == TRUE) # ("until" must be last statement or there is an error) OR: do: # some stuff # some more stuff until (condition == TRUE) OR: ???
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4