Skip to content

Commit f61e82b

Browse files
authored
Merge pull request larymak#149 from keplib/main
"Update year to be dynamic"
2 parents fd24d2d + d0031a6 commit f61e82b

File tree

1 file changed

+7
-1
lines changed
  • TIME SCRIPTS/Age calculator

1 file changed

+7
-1
lines changed

TIME SCRIPTS/Age calculator/age.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import datetime
2+
13
name = input("What is your name: ")
24

35
Birth_Year = int(input("Enter your birth year: "))
46

5-
Current_time = 2022
7+
currentDateTime = datetime.datetime.now()
8+
date = currentDateTime.date()
9+
year = date.strftime("%Y")
10+
11+
Current_time = year
612

713
def age_caluu():
814
Age_calculated = (Current_time - Birth_Year)

0 commit comments

Comments
 (0)