We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 876636e + 24b471e commit cc2e58dCopy full SHA for cc2e58d
TIME SCRIPTS/Age calculator/age.py
@@ -1,16 +1,12 @@
1
-import datetime
+from datetime import date
2
3
name = input("What is your name: ")
4
5
Birth_Year = int(input("Enter your birth year: "))
6
7
-currentDateTime = datetime.datetime.today()
8
-date = currentDateTime.date()
9
-year = date.strftime("%Y")
10
-
11
-Current_time = year
+Current_year = date.today().year
12
13
def age_caluu():
14
- Age_calculated = (Current_time - Birth_Year)
+ Age_calculated = (Current_year - Birth_Year)
15
print ('Hey {} your age is {}'.format(name, Age_calculated))
16
age_caluu()
0 commit comments