Question: Python Programming Leap Year Function Lab Description Write a method for determining if a year is a leap year in the Gregorian calendar. The system

Python Programming

Leap Year Function Lab

Description

Write a method for determining if a year is a leap year in the Gregorian calendar. The system is to check if it is divisible by 4 but not by 100 unless it is also divisible by 400.

For example, 1896, 1904, and 2000 were leap years but 1900 was not. Write a function that takes in a year as input and returns True if the year is a leap year, return False otherwise.

Note: background on leap year https://en.wikipedia.org/wiki/Leap_year

The name of the method should be isleapyear and the method should take one parameter which is the year to test.

Here is an example call to the function

mybirthyear = 2000

If isleapyear(mybirthyear):

print("Year {0} was a leap year".format(mybirthyear))

File Name

isleapyear.py

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!