is_leap_year(year) that returns True if year is a leap year and False otherwise. A year is a leap year if it is divisible by 4, except centuries (divisible by 100), which must also be divisible by 400.is_leap_year(2024)
True
2024 is divisible by 4 and not a century year.
is_leap_year(1900)
False
1900 is divisible by 100 but not by 400.
is_leap_year(2000)
True
2000 is divisible by 400.
Handle the divisible-by-100 exception before the divisible-by-4 rule.
The divisible-by-400 rule overrides the century exception.