Skip to content

Instantly share code, notes, and snippets.

@tanelpuhu
Last active October 17, 2024 19:39
Show Gist options
  • Save tanelpuhu/68b755769372fb9d289a3fa52b315ec9 to your computer and use it in GitHub Desktop.
Save tanelpuhu/68b755769372fb9d289a3fa52b315ec9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import datetime
start = 2000
res = {}
for i in range(90):
year = start + i
dt = datetime.date(year, 12, 31)
key = dt.strftime('%a %j')
res.setdefault(key, []).append(year)
print(len(res))
for years in sorted(res.values()):
print(years)
$ python kalender.py
14
[2000, 2028, 2056, 2084]
[2001, 2007, 2018, 2029, 2035, 2046, 2057, 2063, 2074, 2085]
[2002, 2013, 2019, 2030, 2041, 2047, 2058, 2069, 2075, 2086]
[2003, 2014, 2025, 2031, 2042, 2053, 2059, 2070, 2081, 2087]
[2004, 2032, 2060, 2088]
[2005, 2011, 2022, 2033, 2039, 2050, 2061, 2067, 2078, 2089]
[2006, 2017, 2023, 2034, 2045, 2051, 2062, 2073, 2079]
[2008, 2036, 2064]
[2009, 2015, 2026, 2037, 2043, 2054, 2065, 2071, 2082]
[2010, 2021, 2027, 2038, 2049, 2055, 2066, 2077, 2083]
[2012, 2040, 2068]
[2016, 2044, 2072]
[2020, 2048, 2076]
[2024, 2052, 2080]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment