2 ms·
I really liked the part about for ... else statement, the body of else statement executes the code after the loop finishes but not if break statement was execut
by prolepunk 15y ago
I really liked the part about for ... else statement, the body of else statement executes the code after the loop finishes but not if break statement was executed.
I know about this construct but whenever I have a problem that requires it, I always forget and use old:
if counter -1 == len(obj):
...
ugh.