Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Sep 9, 2021
Embed
What would you like to do?
def ageCalculator(y, m, d):
import datetime
today = datetime.datetime.now().date()
dob = datetime.date(y, m, d)
age = int((today-dob).days / 365.25)
print(age)
ageCalculator(1998, 9, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment