Created
August 25, 2016 16:56
-
-
Save hallazzang/90b39691e09b492fd6152baae1d696b0 to your computer and use it in GitHub Desktop.
Python - is_leap_year
This file contains 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
from datetime import date | |
def is_leap_year(year): | |
try: date(year, 2, 29) | |
except ValueError: return False | |
else: return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment