Files
pyDefis/Calcul des jours magiques.py
2022-10-09 22:21:01 +02:00

17 lines
387 B
Python

import datetime
days = (len("lundi"), len("mardi"), len("mercredi"), len("jeudi"), len("vendredi"), len("samedi"), len("dimanche"))
d = datetime.datetime.strptime("01/01/2000", "%d/%m/%Y")
end = datetime.datetime.now()
ctr = 0
while True:
if (days[d.weekday()] + d.day)%10 == 0:
ctr += 1
d = d + datetime.timedelta(days=1)
if d > end:
break
print(d, ctr)