def leap_year(year: int) -> bool: #takes a year in YYYY format, and returns True if it's
Fantastic news! We've Found the answer you've been seeking!
Question:
def leap_year(year: int) -> bool:
#takes a year in YYYY format, and returns True if it's a leap year, False otherwise#
T = "True"
F = "False"
lyear = year % 4
if lyear == 0:
feb_max = 29
else:
feb_max = 28
lyear = year % 100
if lyear == 0:
feb_max = 28
lyear = year % 400
if lyear ==0:
feb_max = 29
if feb_max == 29:
return T
else:
return F
this is my code
when i try to run my check script i get response-
AssertionError: 'False' != False : leap_year() not returning correct True/False for a specific year
Related Book For
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne
Posted Date: