import calendar


def build_days_of_month_list(start_yr, n_years):
    """Generate a list of days of the month over a number of years that accounts for leap years."""

    days_per_month_leap = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    days_per_month_nonleap = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

    days_per_month = []

    for i in range(start_yr, start_yr + n_years, 1):

        # add days of month to list based on leap status
        if calendar.isleap(i):
            days_per_month.extend(days_per_month_leap)
        else:
            days_per_month.extend(days_per_month_nonleap)

    return days_per_month