A leap year is a year, occurring once every four years, which has 366 days including 29 February as an intercalary day. A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by 400. In this article, we will create aÂ Python program to check leap year.

##### Problem Definition

Create a Python program to check if the year is a leap year or not.

##### Output of mothod 1

In the above program first, we are taking input from the user then converting it to an integer using theÂ `int()`Â method. Then we are performing mathematical operations against the logic that a leap year is exactly divisible by 4 except for century years the century year is a leap year only if it is perfectly divisible by 400.

##### Method 2

Python ships with a module called calendar that has aÂ `isleap()`Â method which returns booleanÂ TrueÂ if the year is a leap year.

##### OutputÂ of mothod 1

First, we are importing theÂ `isleap()`Â method from the calendar module later we are passing the year as an argument to the method along with conditional statements to print out the result.

The article was published on September 14, 2020 @ 5:23 PM