Always forget how to exact determine programmer's day. Some code may help do it exactly and without heavy calculations.
# How to check that target date is Programmer's day?
def is_programmers_day(date):
return date.timetuple().tm_yday == 256
import codewars_test as test
from solution import is_programmers_day
from datetime import datetime, date
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(is_programmers_day(datetime(2021, 9, 13)), True)
test.assert_equals(is_programmers_day(datetime(2020, 9, 12)), True)
test.assert_equals(is_programmers_day(date(2019, 9, 13)), True)
test.assert_equals(is_programmers_day(date(2016, 9, 12)), True)
test.assert_equals(is_programmers_day(date(2000, 9, 12)), True)