For a year to be a leap year, it has to satisfy the following conditions:
- The year is a multiple of 400.
- The year is a multiple of 4 but not 100.
A century year is a year that is a multiple of 100 and ends with 00. For example, 1500 is a century year. The second condition is used to separate the century years from the leap years. A century year is considered to be a leap year only if it is divisible by 400. For instance, the years 1200, 1600, and 2000 are all century leap years. On the other hand, 1300, 1500, and 1900 are century years which do not qualify as leap year.
year = int(input('Enter year: '))
if(year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)):
print(year,'is a leap year')
else:
print(year,'is not a leap year')