2 ms·
What you say implies that you’d be happy with while(condition()): ... else: ... But that makes even less sense since `while` is semantically
by Myrmornis 8y ago
What you say implies that you’d be happy with
while(condition()):
...
else:
...
But that makes even less sense since `while` is semantically like an `if` with continuation. GP is right, it’s rarely used, because the syntax clashes with the natural reading of the code.
- detaro 8y agowhile ... else is a good comparison, yes. and it exists exactly like that in python: if the condition check turns false, the else branch is executed.