def monthrange(year, month):
 if (not (1 <= month <= 12)):
  raise IllegalMonthError(month)
 day1 = weekday(year, month, 1)
 ndays = (mdays[month] + ((month == February) and isleap(year)))
 return (day1, ndays)

def monthrange ( year , month ) : if ( not ( 1 <= month <= 12 ) ) : raise IllegalMonthError ( month ) day1 = weekday ( year , month , 1 ) ndays = ( mdays [ month ] + ( ( month == February ) and isleap ( year ) ) ) return ( day1 , ndays )
return weekday and number of days for year .