hairinmybellybutt@lemmy.world to Programmer Humor@programming.devEnglish · 1 year agocall the doctor, the CS doctorlemmy.worldimagemessage-square42fedilinkarrow-up1420arrow-down129
arrow-up1391arrow-down1imagecall the doctor, the CS doctorlemmy.worldhairinmybellybutt@lemmy.world to Programmer Humor@programming.devEnglish · 1 year agomessage-square42fedilink
minus-squareconditional_soup@lemm.eelinkfedilinkarrow-up7arrow-down1·edit-21 year agodef count_fingers(hand: list): count = len(hand) if count != 5: if count < 5: raise Exception("Check if fingers missing, or just smart ass") else: raise Exception("Oh... oh no.") return count
minus-squareHurgletOfficial@lemmy.basedcount.comlinkfedilinkarrow-up6arrow-down1·edit-21 year agodeleted by creator
minus-squareconditional_soup@lemm.eelinkfedilinkarrow-up1arrow-down1·1 year agoI’ll use ternary operators when you force them into my cold, dead hands
minus-squareHurgletOfficial@lemmy.basedcount.comlinkfedilinkarrow-up7·edit-21 year agodeleted by creator
minus-squareconditional_soup@lemm.eelinkfedilinkarrow-up6arrow-down1·1 year agoYou are correct. I came back to say that I’ll use the walrus operator when it’s pushed into my cold, dead hands, but… I might actually use it, now that I’ve refreshed myself on it.
def count_fingers(hand: list): count = len(hand) if count != 5: if count < 5: raise Exception("Check if fingers missing, or just smart ass") else: raise Exception("Oh... oh no.") return count
deleted by creator
I’ll use ternary operators when you force them into my cold, dead hands
deleted by creator
You are correct. I came back to say that I’ll use the walrus operator when it’s pushed into my cold, dead hands, but… I might actually use it, now that I’ve refreshed myself on it.