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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Introduction To Programming In Java An Interdisciplinary Approach
Authors: Robert Sedgewick, Kevin Wayne
2nd Edition
0672337843, 9780672337840
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App