You can use date function of datetime library. Here is an example:
Let's say mm-dd-yyyy is the date of birth of the person.
from datetime import dateage = date.today().year - int(yyyy)E.g.>>> date.today().year - int('1981')37
from datetime import dateage = date.today().year - int(yyyy)
E.g.
>>> date.today().year - int('1981')37