Skip to content
C

Leap Year Checker

Mediumpython

Determine whether a given year is a leap year.

Rule: a year is a leap year if it's divisible by 4, except century years (divisible by 100), which are only leap years if they're also divisible by 400.

Approach: combine the three checks with and/or: (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0).

Input: One line: a year (a whole number).

Output: One line: <year> is a leap year or <year> is not a leap year.

Input (stdin)

Output

Run your code to see output here...