Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python2
- import sys
- import re
- for line in sys.stdin:
- p = re.compile("^((|[1-9][0-9]+)((0|4|8)|(0|2|4|6|8)(0|4|8)|(1|3|5|7|9)(2|6))|0x[A-Z0-9]?(0|4|8|C))$")
- if p.match(line):
- print ("true")
- else:
- print ("false")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement