• + 17 comments

    The calendar builtin module has a function isleap() that returns True if the year is leap, otherwise it returns False

    import calendar
    
    def is_leap(year):
        return calendar.isleap(year)