-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDateOfBirth.py
More file actions
38 lines (38 loc) · 910 Bytes
/
DateOfBirth.py
File metadata and controls
38 lines (38 loc) · 910 Bytes
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
from datetime import date, datetime
print("date of birth")
dob = int(input())
print("month of birth")
mob = int(input())
print("year of birth")
yob = int(input())
print("how many years")
years = int(input())
Bday = datetime(month = mob, day = dob, year = yob)
index = Bday.weekday()
VIndex = {'dayweek': 0}
x = 0
yob2 = yob + years
for i in range(yob, yob2):
Bday = datetime(month = mob, day = dob, year = yob)
wd = Bday.weekday()
if wd == index:
VIndex["dayweek"] = x + 1
x = x + 1
yob = yob + 1
if index == 0:
g = "monday"
elif index == 1:
g = "tuesday"
elif index == 2:
g = "wednesday"
elif index == 3:
g = "thursday"
elif index == 4:
g == "friday"
elif index == 5:
g = "saturday"
elif index == 6:
g = "sunday"
a = f"You were born on {g} and it is repeated {VIndex['dayweek']} times in {years} years"
print(a)
print("please restart the programme")