from calendar import monthrange year = 2016 month = 2 print(monthrange(year, month))