Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9f922f commit 46735adCopy full SHA for 46735ad
1 file changed
Lib/calendar.py
@@ -54,8 +54,10 @@ def isleap(year):
54
55
def leapdays(y1, y2):
56
"""Return number of leap years in range [y1, y2).
57
- Assume y1 <= y2 and no funny (non-leap century) years."""
58
- return (y2+3)/4 - (y1+3)/4
+ Assume y1 <= y2."""
+ y1 -= 1
59
+ y2 -= 1
60
+ return (y2/4 - y1/4) - (y2/100 - y1/100) + (y2/400 - y1/400)
61
62
def weekday(year, month, day):
63
"""Return weekday (0-6 ~ Mon-Sun) for year (1970-...), month (1-12),
0 commit comments