haps/verifier.py
2015-06-22 19:44:42 +02:00

21 lines
500 B
Python
Executable file

#!/usr/bin/env python3
import argparse, 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__":
parser = argparse.ArgumentParser()
parser.add_argument("age1", type=int)
parser.add_argument("age2", type=int)
args = parser.parse_args()
if verifier(args.age1, args.age2):
print("Have fun.")
else:
print("Nope.")