def next_month(some_date):
    return first_day(first_day(some_date) + timedelta(days=31))

def last_day(some_date):
    return next_month(some_date) - timedelta(days=1)
months = [('Jan-2010', 'Mar-2010'), ('Apr-2009', 'Apr-2009'), ('Jan-2008',
    'Dec-2008'), ('Jan-2007', 'Feb-2007')]
for date1, date2 in months:
    print(first_day(datetime.strptime(date1, '%b-%Y')), end=' ')
print('-', end=' ')
print(last_day(datetime.strptime(date2, '%b-%Y')))
Разбор пар месяца и года в datetime