kyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-21 day agoThe infamous "if loop" actually existsdiscuss.tchncs.deimagemessage-square22fedilinkarrow-up1152arrow-down19file-text
arrow-up1143arrow-down1imageThe infamous "if loop" actually existsdiscuss.tchncs.dekyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-21 day agomessage-square22fedilinkfile-text
minus-squarewise_pancakelinkfedilinkarrow-up4·3 hours agoDid you know python for loops have an else clause? Did you also know it runs after the loop iterator is done, and not when there was never anything to iterate over at all? https://docs.python.org/3/reference/compound_stmts.html#for
minus-squareqaz@lemmy.worldlinkfedilinkEnglisharrow-up4·3 hours agoThat actually seemed quite useful at first.
Did you know python for loops have an else clause?
Did you also know it runs after the loop iterator is done, and not when there was never anything to iterate over at all?
https://docs.python.org/3/reference/compound_stmts.html#for
That actually seemed quite useful at first.