In general, a year is considered **leap year if its divisible by 4** but if year is a century year(ending with two zeroes) then it need to be divisible by 400 to a Leap Year. For example – 2020 is a leap year as its divisible by 4, while 2003 is not a leap year because it cannot be divided by 4.

In this article, I’ll discuss **Python Code for Checking Whether some year is leap year or not**.

**Algorithm for Checking if Year is leap or not**

- If year is divisible by 4, then its Leap Year
- If year is not divisible by 4, then its not a Leap Year
- If year is a Century Year then it need to be divisible by 400 and 100

**Python Code for Checking Leap Year**

```
# Python Code for Checking if year is leap or not
year = int(input("Enter Year => "))
# Dividing year by 4
if (year % 4 == 0):
if (year % 100 == 0):
if (year % 400 == 0):
print(year, "is a Leap year")
else:
print(year, "is not a Leap year")
else:
print(year, "is not a Leap year")
else:
print(year, "is not a Leap year")
```

**Output of Above Code**

```
Enter Year => 2018
2018 is not a Leap year
```