3 ms·
It's analogous to the natural termination of a while-else, where the else block is executed after the condition evaluates to false: >>> a=1 >>> while a
by maxerickson 12y ago
It's analogous to the natural termination of a while-else, where the else block is executed after the condition evaluates to false:
>>> a=1
>>> while a>0:
print(4)
a=a-1
else:
print('done')
4
done
clarity cribbed from here: https://mail.python.org/pipermail/python-list/1999-July/004457.html https://mail.python.org/pipermail/python-list/1999-July/0044...
- MBlume 12y agoOh, that helps too -- it's an else clause for the conditional of the while loop :D