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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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)