21 lines
566 B
Python
Executable file
21 lines
566 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
|
|
def haps(i1, i2):
|
|
try:
|
|
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):
|
|
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 haps(args.age1, args.age2):
|
|
print("Have fun.")
|
|
else:
|
|
print("Nope.")
|