zjfz-2019-s393639/regexp/Task303.py

7 lines
167 B
Python
Raw Permalink Normal View History

2020-01-25 11:09:37 +01:00
import re
def divisable_by_four(string):
wyrazenie = '^[048]$|^[0-9]*([13579][26]|[2468][048])$|^[1-9][0-9]*(00|04|08)$'
return re.search(wyrazenie, string)