Python amount of days in a month with a given year and month? [closed]

You’re probably looking for calendar.monthrange:

>>> calendar.monthrange(2014, 2)
(5, 28)

Looks like February had 28 days this year, and started on a Saturday (0 is Monday.)

Browse More Popular Posts

Leave a Comment