In [1]:
day = 4 + 87
if day > 28:
    day = day - 28
    if day > 31:
        day = day - 31
        if day > 30:
            day = day - 30
            print('May', day)
        else:
            print('April', day)
    else:
        print('March', day)
else:
    print('February', day)
May 2
In [2]:
month_name = ('February', 'March', 'April', 'May')
days_in_month = (28, 31, 30, 31)
In [3]:
month_name[0]
Out[3]:
'February'
In [4]:
month_name[1]
Out[4]:
'March'
In [5]:
month_name[2]
Out[5]:
'April'
In [6]:
month_name[3]
Out[6]:
'May'
In [7]:
m, day = 0, 4 + 87
while day > days_in_month[m]:
    m, day = m + 1, day - days_in_month[m]
month_name[m], day
Out[7]:
('May', 2)
In [8]:
import datetime
datetime.date(2017, 2, 4) + datetime.timedelta(days = 87)
Out[8]:
datetime.date(2017, 5, 2)