from datetime import date def years somedate today date today year tod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from datetime import date
def years(somedate):
today = date.today()
year = today.year - somedate.year
if today.month < somedate.month:
year -= 1
elif date.month == somedate.month and today.day < somedate.day:
print today.day, somedate.day
year -= 1
print year
birthday1 = date(1984, 5, 6)
birthday2 = date(1984, 6, 25)
birthday3 = date(1984, 6, 30)
birthday4 = date(1984, 7, 25)
map(years, (birthday1, birthday2, birthday3, birthday4))