Answered step by step
Verified Expert Solution
Link Copied!

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?image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

Students also viewed these Databases questions