haps/verifier.py
2015-04-27 18:21:30 +02:00

21 lines
460 B
Python
Executable file

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
def verifier(i1, i2):
try:
if int(max(i1, i2)) / 2 + 7 > int(min(i1, i2)) or int(min(i1, i2)) < 14:
return False
return True
except ValueError:
raise ValueError("Arguments must be integers.")
if __name__ == "__main__":
try:
if verifier(*sys.argv[1:]):
print("Have fun.")
else:
print("Nope.")
except TypeError:
raise ValueError(sys.argv[0] + " takes exactly two arguments.")