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 =

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

 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!