描述:
一年有多少天,这是个大问题,很值得思考。现在给你一个年份year(year为四位数字的字符串,如"2008","0012"), 你输出这一年的天数。如year="2013", 则输出365。
from __future__ import print_function year = '2013' def isYear(year): year = int(year) if (year%400 == 0) or ((year%4 == 0) and (year%100 != 0)): print('366',end='') else : print('365',end='') isYear(year)