Leap Year

A year is a leap year if it is divisible by 4, unless it is a century year that is not divisible by 400. (1800 and 1900 are not leap years while 1600 and 2000 are.) Write a Boolean function IsLeap(year) which determines whether a year is a leap year. (A Boolean function implies that its return value will be either True or False.) Test your function with the following main program:

year = eval(input("Input a year - "))
if IsLeap(year):
    print("It is a leap year.")
else:
    print("It is not a leap year.")


The program may run as follows:

Input a year - 2013
It is not a leap year.



Input a year - 2016
It is a leap year.