Leap
From Exercism PythonMITOriginal pagePython1 class period1 exercise9 graded tests
README.md
Leap
Introduction
A leap year (in the Gregorian calendar) occurs:
- In every year that is evenly divisible by 4.
- Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400.
Some examples:
- 1997 was not a leap year as it's not divisible by 4.
- 1900 was not a leap year as it's not divisible by 400.
- 2000 was a leap year!
Note
For a delightful, four-minute explanation of the whole phenomenon of leap years, check out this YouTube video.
Instructions
Your task is to determine whether a given year is a leap year.
Open the
01folder and editmain.py. Run Tests checks it.
For teachers
Leap
Students solve Exercism's “Leap” Python exercise in CS Room, with Exercism's own tests.
- Time: 1 class period
- Tests: 9, set up for you when you import the lesson
- Practices: bools