首先介绍一下闰年:
能被4整除但不能被100整除,或者能被400整除,是闰年
阳历中有闰日的年份叫闰年,相反就是平年,平年为365天,闰年为366天。在公历(格里历)纪年中,
平年的二月为28天,闰年的二月为29天。闰年平月2月29日为闰日。
def isLeapYear(self, year):
year = int(year)
if year % 4== 0 and year % 100 != 0:
return True
elif year % 400== 0:
return True
return False