Dec-03-2024, 12:52 AM
i'm posting this in the bar because i don't know where else to post it. besides, you likely will need to be drunk to do this.
there are 7 different kinds of leap years. there are 7 more different kinds of years that are not leap years. see if you can write a script that, given a year in the range 1753 to 2399 inclusive will list all other years in that range which have the same calendar structure over the months and weeks of each year. listing years should list up to 14 years per line of output line with 1 space between each year on the same line. this should minimize the number of lines output for any requested year.
if the one argument is "test" then it should carry out the above for every year in the range while suppressing output to determine how fast it figures out the list of matching years for each year.
will yours be the most optimal? calling built-in Python functions is expected. i'll download what gets posted in a few weeks and see which is fastest on my laptop (x86_64 Linux Ubuntu 20.04 with Python 3.8.10) or someone else can do that if a newer Python would make a more fair comparison.

there are 7 different kinds of leap years. there are 7 more different kinds of years that are not leap years. see if you can write a script that, given a year in the range 1753 to 2399 inclusive will list all other years in that range which have the same calendar structure over the months and weeks of each year. listing years should list up to 14 years per line of output line with 1 space between each year on the same line. this should minimize the number of lines output for any requested year.
if the one argument is "test" then it should carry out the above for every year in the range while suppressing output to determine how fast it figures out the list of matching years for each year.
will yours be the most optimal? calling built-in Python functions is expected. i'll download what gets posted in a few weeks and see which is fastest on my laptop (x86_64 Linux Ubuntu 20.04 with Python 3.8.10) or someone else can do that if a newer Python would make a more fair comparison.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.