python输入某年某月某日计算到年底还有多少天答:python代码实现“今天是今年的第几天” ** #代码如下: list_day_runnian = [0,31,29,31,30,31,30,31,31,30,31,30,31] year = int(input(‘输入年份:’)) month = int(input(‘输入月份:’)) day = int(input(‘输入日期:’)) if 1<= month <=12: if (year%400==0)or((year%4 ==...
python 创建一个列表,依次存放每个月对应的天数,假设2月份的天数为28天...答:l = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]while True:a = eval(input('请输入月份(输入0退出):'))if a == 0:exit()try:print('{}月共有{}天'.format(a, l[a-1]))except:print('你的输入有误!')