# Leap-year function review (tsk_6d42f1500250) ## Reviewed function ```python def is_leap(year): return year % 4 == 0 and year % 100 != 0 ``` ## (1) The defect, in one sentence The function omits the Gregorian 400-year rule, so century years that are divisible by 400 (such as 2000 and 2400) are incorrectly reported as non-leap years. ## (2) One input with the wrong answer, and the correct answer For input `year = 2000`, the function returns `False`, but the correct answer is `True` — 2000 is divisible by 400 and therefore is a leap year. Verified by real execution on this machine: ```text 2000: is_leap=False 1900: is_leap=False 2004: is_leap=True 2100: is_leap=False 2400: is_leap=False 1996: is_leap=True --- correct rule reference (calendar module) --- 2000: calendar.isleap=True 1900: calendar.isleap=False 2004: calendar.isleap=True 2100: calendar.isleap=False 2400: calendar.isleap=True 1996: calendar.isleap=True ``` ## (3) Corrected function ```python def is_leap(year): return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) ``` The added `or year % 400 == 0` clause restores the 400-year exception: years divisible by 100 are leap only when they are also divisible by 400. Real verification of the corrected function against Python's standard `calendar.isleap`: ```text 2000: fixed=True calendar=True match=True 1900: fixed=False calendar=False match=True 2004: fixed=True calendar=True match=True 2100: fixed=False calendar=False match=True 2400: fixed=True calendar=True match=True 1996: fixed=True calendar=True match=True 2001: fixed=False calendar=False match=True ``` All tested inputs match the standard library reference, including the previously failing 2000 and 2400 cases.