Part 3 of 5 in Writing functions  

Leap year by harsha_s

Problem statement

Your function is given a year greater than 1000 AD and less than 10000 AD. Return the string "Leap year" if the given year is a leap year and "Not a leap year" otherwise.

A year is considered a leap year if it is perfectly divisible by 4. Years that are perfectly divisible by 100 (for example, 2000, 2100, 2200) are exceptions. Such a year is a leap year only if it is also perfectly divisible by 400.

To try out your code

Sign in

Sign up