which occurs first or how many days separate the two dates we are going to use the latter approach as it is very common for storing dates in computer applications and provides for an easy implementation listing partial implementation of the date py module implements proleptic gregorian calendar date as julian day number class date creates an object instance for the specified gregorian date def __init__selfmonthdayyear )self _julianday assert self _isvalidgregorianmonthdayyear )"invalid gregorian date the first line of the equationt ( has to be changed since python' implementation of integer division is not the same as the mathematical definition tmp if month tmp - self _julianday day ( (year tmp/ ( (month tmp / ( ((year tmp/ / extracts the appropriate gregorian date component def monthself )return (self _togregorian())[ returning from (mdydef dayself )return (self _togregorian())[ returning from (mdydef yearself )return (self _togregorian())[ returning from (mdyreturns day of the week as an int between (monand (sundef dayofweekself )monthdayyear self _togregorian(if month month month year year return (( month / day year year / year / year / returns the date as string in gregorian format def __str__self )monthdayyear self _togregorian(return "% /% /% (monthdayyearlogically compares the two dates def __eq__selfotherdate )return self _julianday =otherdate _julianday (listing continued