Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jun 13, 2020, 11:13 PM EDT
Akshay ShedwadRank #1,537 · 1K reputationPosted Jun 14, 2020, 2:11 AM EDT
Sagar LadRank #523 · 4.7K reputationPosted Aug 19, 2021, 10:47 AM EDT
Hi Guru,
import calendar
>>> calendar.monthrange(2002, 1)
(1, 31)
>>> calendar.monthrange(2008, 2) # leap years are handled correctly
(4, 29)