That can be done much simpler considering that int(True) is 1 and int(False)
is 0:
from datetime import datedef calculate_age(born): today = date.today() return today.year - born.year - ((today.month, today.day) < (born.month, born.day))

That can be done much simpler considering that int(True) is 1 and int(False)
is 0:
from datetime import datedef calculate_age(born): today = date.today() return today.year - born.year - ((today.month, today.day) < (born.month, born.day))