Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python I cannot figure out why this isn't working. I'm trying to calculate if a leap year. Where is my error? def isLeapYear(year): leapYear =
Python
I cannot figure out why this isn't working. I'm trying to calculate if a leap year. Where is my error?
def isLeapYear(year): leapYear = False for thing in year: while (int(thing) % 4 == 0) and not (int(thing) % 100 == 0 and int(thing) % 400 != 0): leapYear = True return print("Is it a leap year?", leapYear) else: leapYear = False return print("Is it a leap year?", leapYear) isLeapYear(input("What Year?")) What Year? 2020 Is it a leap year? FalseStep 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 Started