@author jackzhenguo
@desc
@date 2019/10/13
import calendar
from datetime import date
mydate = date.today()
is_leap = calendar.isleap(mydate.year)
print_leap_str = "%s年是闰年" if is_leap else "%s年不是闰年\n"
print(print_leap_str % mydate.year)
打印结果:
2019年不是闰年