Skip to content

Commit 054360f

Browse files
committedAug 16, 2019
2019-08-15
1 parent 44aefc1 commit 054360f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎1118.一月有多少天/1118-一月有多少天.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ def numberOfDays(self, Y, M):
66
:rtype: int
77
"""
88

9-
if (Y % 100 != 0 and Y % 4 ==0) or (Y % 100 == 0 and Y % 400 == 0) :
9+
if (Y % 100 != 0 and Y % 4 ==0) or Y % 400 == 0:
1010
return [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][M - 1]
1111
else:
12-
return [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][M - 1]
13-
12+
return [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][M - 1]

0 commit comments

Comments
 (0)