Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Unlucky Days by sskh53
from datetime import date
def checkio(year):
month=range(1,13)
ans = 0
for x in month:
if date(year, x, 1).weekday() == 6:
ans += 1
return ans
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert checkio(2015) == 3, "First - 2015"
assert checkio(1986) == 1, "Second - 1986"
March 25, 2016