问题: 输入某年某月某日,判断这一天是这一年的第几天
def isLeapYear(y): # 这里用函数定义有什么好处?我想的是用if
return (y%400==0 or (y%4==0 and y%100!=0))
DofM=[0,31,28,31,30,31,30,31,31,30,31,30] # 第一个数据为什么是0?
res=0
year=int(input('Year:'))
month=int(input('Month:'))
day=int(input('day:'))
if isLeapYear(year):
DofM[2]+=1
for i in range(month):
res+=DofM[i]
print(res+day)