def _get_firstbday(wkday):
 first = 1
 if (wkday == 5):
  first = 3
 elif (wkday == 6):
  first = 2
 return first

def _get_firstbday ( wkday ) : first = 1 if ( wkday == 5 ) : first = 3 elif ( wkday == 6 ) : first = 2 return first
wkday is the result of monthrange if its a saturday or sunday .