Question: 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?Python I cannot figure out why this isn't working. I'm trying to

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? False

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 Databases Questions!