feat: update leap_year.py
This commit is contained in:
@@ -19,9 +19,9 @@ def get_day_of_month(year, month: int) -> int:
|
|||||||
|
|
||||||
|
|
||||||
def get_day_of_month2(year, month: int) -> int:
|
def get_day_of_month2(year, month: int) -> int:
|
||||||
if [1, 3, 5, 7, 8, 10, 12].__contains__(month):
|
if month in {1, 3, 5, 7, 8, 10, 12}:
|
||||||
return 31
|
return 31
|
||||||
elif [4, 6, 9, 11].__contains__(month):
|
elif month in {4, 6, 9, 11}:
|
||||||
return 30
|
return 30
|
||||||
elif month == 2 and is_leap_year(year):
|
elif month == 2 and is_leap_year(year):
|
||||||
return 29
|
return 29
|
||||||
|
|||||||
Reference in New Issue
Block a user