Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Long-year/Python/long-year.py
Normal file
25
Task/Long-year/Python/long-year.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
'''Long Year ?'''
|
||||
|
||||
from datetime import date
|
||||
|
||||
|
||||
# longYear :: Year Int -> Bool
|
||||
def longYear(y):
|
||||
'''True if the ISO year y has 53 weeks.'''
|
||||
return 52 < date(y, 12, 28).isocalendar()[1]
|
||||
|
||||
|
||||
# --------------------------TEST---------------------------
|
||||
# main :: IO ()
|
||||
def main():
|
||||
'''Longer (53 week) years in the range 2000-2100'''
|
||||
for year in [
|
||||
x for x in range(2000, 1 + 2100)
|
||||
if longYear(x)
|
||||
]:
|
||||
print(year)
|
||||
|
||||
|
||||
# MAIN ---
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue