Python3:使用函数计算-输入日期,计算该日期是当年中第多少天
#使用函数判断某日是一年内第多少天
#判断是否是闰年函数
def leapYear(year):
if year%400 == 0 or (year%4 == 0 and year%100 != 0):
return 1
#使用列表统计一个年中每个月有多少天
def monthDays(year):
if leapYear(year):
month...
原创
2019-01-04 08:34:22 ·
2489 阅读 ·
1 评论