@Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish • 22 hours agoRulelemmy.blahaj.zoneimagemessage-square53fedilinkarrow-up1352arrow-down16
arrow-up1346arrow-down1imageRulelemmy.blahaj.zone@Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish • 22 hours agomessage-square53fedilink
minus-square@bob_lemon@feddit.orglinkfedilink45•edit-220 hours agoimport re def is_even(i: int) -> bool: return re.match(r"-?\d*[02468]$", str(i)) is not None
minus-squarelime!linkfedilinkEnglish2•9 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