-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAge Calculator.py
46 lines (35 loc) · 901 Bytes
/
Age Calculator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
This is an age calculator which will tell you your current age,
by entering your date of birth.
"""
print("AGE CALCULATOR".center(45) + '\n' + '\n')
# Function for years....
import datetime
current_year = datetime.datetime.now().year
# Function for months....
import datetime
current_month = datetime.datetime.now().month
# Function for days....
from datetime import date
today = date.today()
from datetime import datetime
""""
current_time = datetime.now()
print(current_time.strftime("%H:%M:%S")
)
"""
print("Enter Your Date Of Birth".upper() + '\n'
)
d1 = int(input("date:".upper()
)
)
m1 = int(input("month:".upper()
)
)
y1 = int(input("year:".upper()
)
)
print('\n' "Age".upper() , "=" , current_year - y1, "Years", current_month - m1,
"Months",
today.day - d1, "Days" + '\n'
)