![]() |
#2
hziee2011-11-16 15:43
|
def _days_before_month(month, year): # number of days in year before month
return _DAYS_BEFORE_MONTH[month-1] + (month > 2 and _is_leap(year))
注:_is_leap(year)是前面定义的一个判定闰年的函数,
_DAYS_BEFORE_MONTH[month-1]取出的是一个数,
我不明白,难道后面的条件用括号括起来就成了数字?而且应该是1.。。。。求解释