标签:raw inpu bsp print 输入 == 某年 put python基础
#判断某年的第几天
days=[0,31,59,90,120,151,181,212,243,273,304,334]
year=int(raw_input(‘nian:\n‘))
month=int(raw_input(‘yue:\n‘))
day=int(raw_input(‘ri:\n‘))
if (year % 400 == 0) or (year % 4 == 0) and (year % 100 != 0):
if month >=3:
answer=days[month-1]+day+1
print ‘第‘,answer,‘天‘
else:
answer=days[month-1]+day
print ‘第‘,answer,‘天‘
else:
answer=days[month-1]+day
print ‘第‘,answer,‘天‘
标签:raw inpu bsp print 输入 == 某年 put python基础
原文地址:http://www.cnblogs.com/jietingting/p/7076847.html