#!/usr/bin/env python
# coding: utf-8
# # Age Calculator using Python
# In[20]:
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)
#y=year m=month d=day
ageCalculator(2001 , 8, 1)
#clcoding.com
# In[ ]:
0 Comments:
Post a Comment