You are viewing a single thread.
View all comments
52 points
*
import re

def is_even(i: int) -> bool:
    return re.match(r"-?\d*[02468]$", str(i)) is not None
permalink
report
reply
23 points

Cursed

permalink
report
parent
reply
5 points

i was gonna suggest the classic

re.match(r"^(..)\1*$", "0" * abs(i)) is not None
permalink
report
parent
reply