# 输入某年某月某日,判断这一天是这一年的第几天?
year = int(input('please input the year:'))
month = int(input('please input the month:'))
day = int(input('please input the day:'))
days = [0,31,59,90,120,151,181,212,243,273,304,334,366]
result = 0
if 0< month<=12:
result = days[month]
else:
result = 0
result += day
if year%400==0 or (year%4==0 and year%100 !=0):
if month >2:result +=1
print(year,month,day,result)
这样一个判断日子的小程序,在输入 1月1日的时候 显示的的是32天
也就是说初始直设定的有问题
暂时还没有想清楚原因,mark了