You must log in or register to comment.
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
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
re.match(r"^(..)\1*$", "0" * abs(i)) is not None