Python 输入一个年份,判断是否为闰年

闰年: 4的倍数,但是不能被100整除,且能被400整除

year = int (input ( "请输入年份:" ))
if (year % 4 ==0  and  year % 100 !=0)  or  year % 400 ==0:
    print("yes!")
else:print("no!")
发布了6 篇原创文章 · 获赞 0 · 访问量 71

猜你喜欢

转载自blog.csdn.net/camm520/article/details/105063816
今日推荐