diff --git a/regexp/Task305.py b/regexp/Task305.py new file mode 100644 index 0000000..ab2897e --- /dev/null +++ b/regexp/Task305.py @@ -0,0 +1,12 @@ +import re + + +def divisable_by_two(string): + if string.isdigit() == True : + last = string[-1] + if string.startswith('-') | (len(string)>1 and string.startswith('0')): + return False + else: + return bool(re.match(r"2|4|6|8|0", last)) + else: + return False \ No newline at end of file