@Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish • 2 months agoRulelemmy.blahaj.zoneimagemessage-square57fedilinkarrow-up1386arrow-down16
arrow-up1380arrow-down1imageRulelemmy.blahaj.zone@Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish • 2 months agomessage-square57fedilink
minus-square@bob_lemon@feddit.orglinkfedilink50•edit-22 months agoimport re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
minus-squarelime!linkfedilinkEnglish5•2 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