Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #!/usr/bin/python2
  2.  
  3. import sys
  4. import re
  5.  
  6. for line in sys.stdin:
  7. 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))$")
  8. if p.match(line):
  9. print ("true")
  10. else:
  11. print ("false")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement