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