We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The issue is you must test that it is divisible by 4 but not divisible by 100.
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
leap = True
1992 was a leap year becauses it is divisble by 4 but not ending in 00 which would make it divisible by 100. If you manually input 1992 and it said False then that is the issue. 1992 was a leap year.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
The issue is you must test that it is divisible by 4 but not divisible by 100.
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): leap = True
1992 was a leap year becauses it is divisble by 4 but not ending in 00 which would make it divisible by 100. If you manually input 1992 and it said False then that is the issue. 1992 was a leap year.