0
点赞
收藏
分享

微信扫一扫

python 闰年判断

左小米z 2022-05-05 阅读 203
python


def isLeapYear(year):
    if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
        print('{0}是闰年'.format(year))
        return True

    else:
        print('{0}不是闰年'.format(year))
        return False

year=eval(input('请输入年份:'))
isLeapYear(year)
举报

相关推荐

0 条评论