w3resource
w3resource logo

Python TextCalendar Module : isleap() method

(追記) (追記ここまで)
(追記) (追記ここまで)

isleap() method

The isleap() method returns True if the year is a leap year, otherwise False.

Note : A leap year is a year containing one additional day added to keep the calendar year synchronized with the astronomical or seasonal year.

Syntax:

isleap(year)

Parameters:

Name Description Required /
Optional
Type
year Year to test leap year or not. Required Number

Example - 1: isleap() method

import calendar
print(calendar.isleap(2016))

Output:

True

Example -2: isleap() method

import calendar
print(calendar.isleap(2015))

Output:

False

PREV :firstweekday()
NEXT :leapdays()

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.

(追記) (追記ここまで)


(追記) (追記ここまで)
(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /