Skip to content

Commit d0031a6

Browse files
committed
"Update year to be dynamic"
1 parent fd24d2d commit d0031a6

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

+7-1
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)