year = int("2016")
if (year % 4) == 0:
      if (year % 100) == 0:
              if (year % 400) == 0:
                      print("{0} is a leap year".format(year))
              else:
                      print("{0} is not a leap year".format(year))
      else:
              print("{0} is a leap year".format(year))
else:
      print("{0} is not a leap year".format(year))
Вывод результата:
2016 is a leap year


 Похожие публикации
2015-11-30 • Просмотров [ 648 ]