Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 1 day agoRulelemmy.blahaj.zoneimagemessage-square53fedilinkarrow-up1363arrow-down16
arrow-up1357arrow-down1imageRulelemmy.blahaj.zonePersona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 1 day agomessage-square53fedilink
minus-squarebob_lemon@feddit.orglinkfedilinkarrow-up47·edit-21 day agoimport re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up4·19 hours 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
i was gonna suggest the classic
Cursed