# # return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0 # 判断是否为闰年 # def leap(n,m): # ret =[] # for i in range(n,m): # if (i % 4 ==0 and i %100 !=0) or i %400==0: # c = i # ret.append(c) # return ret # print(leap(1000,2050))
原文:https://www.cnblogs.com/libragyf/p/12110873.html