Count the number of days between two days.
same as last time, highlight to see answer(s), in python, below.
def fn(*args):
x = '/'.join(str(i) for i in args[:3])
y = '/'.join(str(i) for i in args[3:])
return abs((datetime.strptime(x,"%Y/%m/%d")-datetime.strptime(y,"%Y/%m/%d")).days)
fn(2001,1,1,2002,2,2)
#depending on input format, could do a one-liner:
def fn(x,y): abs((datetime.strptime(x,"%Y/%m/%d")-datetime.strptime(y,"%Y/%m/%d")).days)
#it's probably possible to replace "%Y/%m/%d" with "%c"
[More programming riddles]