python calculate age from date of birth

Solutions on MaxInterview for python calculate age from date of birth by the best coders in the world

showing results for - "python calculate age from date of birth"
Lilli
09 Jun 2016
1from datetime import date
2
3def calculate_age(born):
4    today = date.today()
5    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
Cecilia
12 Feb 2019
1import datetime 
2Year_of_birth = int(input("In which year you took birth:- "))
3current_year = datetime.datetime.now().year
4Current_age = current_year - Year_of_birth
5print("Your current age is ",Current_age)
Abdallah
11 Jan 2018
1today_date = datetime.datetime.now()
2dob = datetime.datetime(1982, 5, 20)
3print(today_date - dob)
Paolo
22 Sep 2017
1#Python Calculate Age from date of birth:
2
3from datetime import date
4
5def calculate_age(born):
6    today = date.today()
7    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
queries leading to this page
python taking in date of birth and calculating exact agehow to predict age from birth year in pythonfind age from date of birth and today pythonhow to get member age based on date of birth using pythonpython calc age receive birthdatehow can i calculate the age in pythonpython age from date of birth how to get the age of given birth date in pythonhow to check age from birthdate in pythonhow to find current age from date of birth in pythonage calculator using pythonreturn age from date of birth pythonhow to know someone 27s age by birthdate in pythonpython calculate age with birth datepython get birth year from agecalcul age from date pythonpython get age based on datepython calculate age in daysdate of birth age calculator pythonhow to find age from date of birth in pythoncalculate age from birthdate pythonpython calculate age age calculation in pythonhow to find age from birthdate in pythonage calculator in python using tkintercalculate age from birthdate pythondate of birth pythoncalculate age python fucntioncalculate age in pythonhow to enter date of birth in pythonpython calculate age based on yearpython program to calculate age in yearcalculating age pythoncalculate age in particular year pythonget age from birthdate python datetimepython birthdate check agepython calculate age from birthdatecalculate age in days pythonpython calculate birth year from agepython from age to birth yearprogram to calculate age in pythonpython program to calculate age age calculator in pythoncalculate age from date of birth in pythoncalculate age from date of birth pythonpython age calculatorhow to find age using pythonage calculator pythonpython calculate age from yearbirth calculator by age pythonpython calculate exact age from date of birthpython calculate age from date of birth days month yearpython datetime calculate agewrite a program to calculate age in pythonhow to calculate the age code pythonhow to fetch current age from date of birth in pythonpython calculate age from date of birthcompute age from birthdate pythonpython calculate age from datepython get age from datefind age using pythonpython get age from birthdateget age from date of birth pythondate of birth from age pythonpython datetime module calculate agehow to calculate age from birth date in datetime pythonpython get date of birthpython cal agepython birth calculatorhow to calculate age from birthdate colume in pythoncal age using pythoncalculate age from data pythonhow to calculate age in pythonpython calc agehow to get age using birthdate and current date in pythoncalculator age oythoncalculate age from birthdate python at particular datepython how to show your ageage calculator code in pythonhow to calculate the exact age of someone with the birth date 3f pythonpython date of birth to agepython calcualte age from date of birthpython calculate age from date of birth