Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Unlucky Days by Moff
from datetime import date, timedelta
def checkio(year):
result = 0
td = timedelta(days=1)
d1 = date(year=year, month=1, day=1)
d2 = date(year=year+1, month=1, day=1)
while d1 <= d2:
if d1.weekday() == 4 and d1.day == 13:
result += 1
d1 += td
return result
March 1, 2016