Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hanksims/650176 to your computer and use it in GitHub Desktop.
Save hanksims/650176 to your computer and use it in GitHub Desktop.
"""
A standalone Python script to utterly refute some wide-circulation bullshit that is currently softening many minds.
"""
import datetime
i = 1900
j = 2100
valid = []
while i < j:
dates = [datetime.date(i, 10, d + 1) for d in range(31)]
fridays = len([d for d in dates if d.weekday() == 4]) > 4
saturdays = len([d for d in dates if d.weekday() == 5]) > 4
sundays = len([d for d in dates if d.weekday() == 6]) > 4
if fridays and saturdays and sundays:
valid.append(i)
i = i + 1
print(valid)
# returns [1909, 1915, 1920, 1926, 1937, 1943, 1948, 1954, 1965, 1971, 1976, 1982, 1993, 1999, 2004, 2010, 2021, 2027, 2032, 2038, 2049, 2055, 2060, 2066, 2077, 2083, 2088, 2094]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment