zjfz-2019-s439462/regexp/Task303.py

6 lines
141 B
Python
Raw Normal View History

2020-01-23 12:38:31 +01:00
import re
def divisable_by_four(string):
return re.search("^[048]$|^[0-9]*([13579][26]|[2468][048])$|^[1-9][0-9]*(00|04|08)$", string)