A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
10
Task/Five-weekends/Python/five-weekends-2.py
Normal file
10
Task/Five-weekends/Python/five-weekends-2.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
LONGMONTHS = (1, 3, 5, 7, 8, 10, 12) # Jan Mar May Jul Aug Oct Dec
|
||||
def fiveweekendspermonth2(start=START, stop=STOP):
|
||||
return [date(yr, month, 31)
|
||||
for yr in range(START.year, STOP.year)
|
||||
for month in LONGMONTHS
|
||||
if date(yr, month, 31).timetuple()[6] == 6 # Sunday
|
||||
]
|
||||
|
||||
dates2 = fiveweekendspermonth2()
|
||||
assert dates2 == dates
|
||||
Loading…
Add table
Add a link
Reference in a new issue