3 ms·
Python has an ‘else’ block for ‘while’ and ‘for’ which executes when the loop completes without a break or return. Never used it myself but it is probably hand
by UncleEntity 4y ago
Python has an ‘else’ block for ‘while’ and ‘for’ which executes when the loop completes without a break or return.
Never used it myself but it is probably handy, handy enough to be included in the language at least.
- levodelellis 4y ago_OnComplete works on while and for loops. There's an empty as well and I'm not sure if empty should also execute complete or not. I figure I'll know after writing real code in more than one project