On this page
  1. calendar.isleap
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

calendar.isleap

Prev: calendar.IllegalWeekdayError | Up: calendar | Next: calendar.leapdays
Rel: calendar.calendar, calendar.Calendar, calendar.Day, calendar.firstweekday
Ref: docs.python.org — calendar.isleap
Tags: #public #python3 #stdlib #calendar


Import

import calendar
from calendar import isleap

Signature & Overview

calendar.isleap(year)

Return True for leap years, False for non-leap years.

Usage

import calendar

assert calendar.isleap(2024) is True
assert calendar.isleap(1900) is False
assert calendar.isleap(2000) is True

Gotchas

REPL Inspect

from calendar import isleap
help(isleap)

Linked from

Related notes