Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
first solution for solution in Clear category for Unlucky Days by boris_bondarenko
from datetime import datetime
def checkio(year: int) -> int:
return len([i for i in range(1,13) if datetime.strptime(f'01/{i}/{year}', '%d/%m/%Y').weekday() == 6])
if __name__ == '__main__':
print("Example:")
print(checkio(2015))
#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"
print("Coding complete? Click 'Check' to earn cool rewards!")
Dec. 22, 2021
Comments: