Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 3 months agoRulelemmy.blahaj.zoneimagemessage-square50fedilinkarrow-up1379arrow-down15
arrow-up1374arrow-down1imageRulelemmy.blahaj.zonePersona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 3 months agomessage-square50fedilink
minus-squarebob_lemon@feddit.orglinkfedilinkarrow-up51·edit-23 months agoimport re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up6·3 months 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