2015-04-27 16:21:30 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2015-11-20 22:40:17 +00:00
|
|
|
import argparse
|
2015-04-27 16:21:30 +00:00
|
|
|
|
2016-02-08 00:32:17 +00:00
|
|
|
def haps(i1, i2):
|
2015-04-27 16:21:30 +00:00
|
|
|
try:
|
2016-02-08 00:32:17 +00:00
|
|
|
if (max(i1, i2) / 2 + 7 > min(i1, i2) and max(i1, i2) - min(i1, i2) > 2) or (min(i1, i2) < 14 and (max(i1, i2) - min(i1, i2) > 1) or min(i1, i2) < 12):
|
2015-04-27 16:21:30 +00:00
|
|
|
return False
|
|
|
|
return True
|
|
|
|
except ValueError:
|
|
|
|
raise ValueError("Arguments must be integers.")
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2015-06-22 17:44:42 +00:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("age1", type=int)
|
|
|
|
parser.add_argument("age2", type=int)
|
|
|
|
args = parser.parse_args()
|
2016-02-08 00:32:56 +00:00
|
|
|
if haps(args.age1, args.age2):
|
2015-06-22 17:44:42 +00:00
|
|
|
print("Have fun.")
|
|
|
|
else:
|
|
|
|
print("Nope.")
|