首页 > 编程语言 > 详细

python 判断平年还是闰年

时间:2016-06-28 20:11:15      阅读:536      评论:0      收藏:0      [点我收藏+]
while 1:   
   s = input(请填入一个年份:)
   s = int(s)
   
   year = False
   
   if s % 100 == 0 and s % 400 == 0:
      year = True   

   elif s % 100 != 0 and s % 4 == 0:   

      year = True

   if year:
      print(闰年)
   else:
      print(平年)
         

 

python 判断平年还是闰年

原文:http://www.cnblogs.com/wumac/p/5624662.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!