how to use datetime to tell your age in python

Solutions on MaxInterview for how to use datetime to tell your age in python by the best coders in the world

showing results for - "how to use datetime to tell your age in python"
Lennard
20 Jun 2017
1today_date = datetime.datetime.now()
2dob = datetime.datetime(1982, 5, 20)
3print(today_date - dob)