def isLeapYear( year ):
    """Assume year is an integer.  See if it's a leap year."""
    # I did this one for you. 
    return (( year % 4 == 0 ) and ( not ( year % 100 == 0 ) or ( year % 400 == 0 )))

def daysInYear( year ):
    """Assume year is an integer. Return the number of days in year."""
    [your code goes here]

def validYear( year ):
    """Assume that the year is an integer.  Check if it's a year after 1752.""" 
    [your code goes here]

def validMonth( month ):
    """Assume that the month is an integer. Check if it's a legal month: 1..12."""
    [your code goes here]

def validDay( day, month, year ):
    """Assume the day is an integer and the month and year are legal. Check
    if day is legal for that month in that year."""
    [your code goes here]

def validDate( day, month, year ):
    """Return a boolean indicating whether the day, month, year designate a valid date."""
    [your code goes here]

def datesInOrder( day1, month1, year1, day2, month2, year2):
    """Return a boolean indicating whether date1 is no later than date2.
    Note: it's OK if the dates are the same. Assume the dates are legal."""
    [your code goes here]

def computeOrdinalDate( day, month, year ):
    """Assume that the date is legal. Compute the ordinal date for any
    date of any year in the Gregorian calendar (which began in 1753).
    Return the ordinal date and the number of days remaining in the year.

    """
    [your code goes here]
    
    # The ordinal date is in variable ordinalDate.  We also need how
    # many days are in the rest of the year.
    remainingDays = ( daysInYear( year ) - ordinalDate )
    return ordinalDate, remainingDays

def daysBetween( day1, month1, year1, day2, month2, year2 ):
    """Compute the number of days between the two dates given.  Assume
       that the two dates are valid and that date2 follows date1. 

    """
    [your code goes here]

def main():
    """Loop to accept from the user two dates, validate them, and display
    the number of intervening days.  If either date is illegal, print
    an error and accept another pair.  Also check that date2 follows
    date1 chronologically.  Stop when the first date is (0,
    0, 0).  You can assume that all user inputs are non-negative
    integers.

    """
    [your code goes here]

main()        
