Created
July 24, 2015 15:01
-
-
Save ejmurray/bc0c39de4fc1b7c04381 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
__author__ = 'Ernest' | |
def is_leap_year(x): | |
if x % 4 == 0 and x % 100 != 0: | |
print "%r was a leap year" % x | |
elif x % 400 == 0: | |
print "%r was a leap year" % x | |
else: | |
print "%r was not a leap year" % x | |
is_leap_year(2000) | |
is_leap_year(0) | |
is_leap_year(1996) | |
is_leap_year(1993) | |
is_leap_year(1972) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment