You are viewing a single comment's thread. Return to all comments →
DRY!!! Don't implement logic that comes in the standard library
from datetime import date def is_leap(year): try: date(year, 2, 29) return True except ValueError: return False
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
DRY!!! Don't implement logic that comes in the standard library