IO 😇@lemmy.blahaj.zone to Lemmy Shitpost@lemmy.worldEnglish · 1 month agomonumentalelemmy.blahaj.zoneimagemessage-square35fedilinkarrow-up1379arrow-down14
arrow-up1375arrow-down1imagemonumentalelemmy.blahaj.zoneIO 😇@lemmy.blahaj.zone to Lemmy Shitpost@lemmy.worldEnglish · 1 month agomessage-square35fedilink
minus-squarezr0@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up63arrow-down1·1 month agoIs the function called is_even()?
minus-squarekryptonianCodeMonkey@lemmy.worldlinkfedilinkarrow-up18·1 month agodef is_even(num:int) -> bool: if x < 0: x = x * (-1) if x == 0: return True elif x == 1: return False elif x == 2: return True elif x == 3: return False elif x == 4: return True elif x == 5: return False elif x == 6: return True elif x == 7: return False # ...
minus-squareReuben@lemmy.nzlinkfedilinkarrow-up32·1 month agoHere, I optimised it: private function is_even(integer): integer = 2; return True;
minus-squareolenkoVD@lemmy.dbzer0.comlinkfedilinkarrow-up14·1 month agowhat unholy combination of programming languages is this
minus-squareTaldan@lemmy.worldlinkfedilinkarrow-up18·1 month agoYes, and it only returns, “I can’t even”
Is the function called
is_even()?def is_even(num:int) -> bool: if x < 0: x = x * (-1) if x == 0: return True elif x == 1: return False elif x == 2: return True elif x == 3: return False elif x == 4: return True elif x == 5: return False elif x == 6: return True elif x == 7: return False # ...Here, I optimised it:
private function is_even(integer): integer = 2; return True;what unholy combination of programming languages is this
Yes, and it only returns, “I can’t even”