Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 17 days agoRulelemmy.blahaj.zoneexternal-linkmessage-square46fedilinkarrow-up1344arrow-down15
arrow-up1339arrow-down1external-linkRulelemmy.blahaj.zonePersona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 17 days agomessage-square46fedilink
minus-squarebob_lemon@feddit.orglinkfedilinkarrow-up48·edit-217 days agoimport re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up5·16 days agoi was gonna suggest the classic re.match(r"^(..)\1*$", "0" * abs(i)) is not None
import re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
Cursed
i was gonna suggest the classic