def IsLeapYear(year):
    """Returns 1 if year is a leap year, zero otherwise."""
    if year%4 == 0:
        if year%100 == 0:
            if year%400 == 0:
                return 1
            else:
                return 0
        else:
            return 1
    else:
        return 0
Returns 1 if year is a leap year, zero otherwise.
recipes/Python/117215_A_Date_module/recipe-117215.py