Created
January 9, 2023 13:38
-
-
Save jmccardle/e5d5c04267b32edb17f53de5054b3268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, timedelta | |
def eight_digit_date(d: str): | |
return all([str(x) in d for x in range(8)]) | |
valid_dates = [] | |
d = date(year=2000, day=1, month=1) | |
while d.year < 2100: | |
if eight_digit_date(d.isoformat()): valid_dates.append(d) | |
d += timedelta(days=1) | |
print(len(valid_dates)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment