Python核心编程:课后练习5.4

判断一个年份是否是闰年:规律是四年一闰,百年不闰,四百年再闰。

while True:
      year=input('Enter year:')
      if year%4 !=0:
          print 'the year is not'
      elif year%100==0:
          if year%400==0:
              print 'the year is right'
          else:
              print 'is not'
      else:
          print 'is right'

posted @ 2013-10-21 22:26  dossec  阅读(190)  评论(0编辑  收藏  举报