def monomial_max(*monoms):
 M = list(monoms[0])
 for N in monoms[1:]:
  for (i, n) in enumerate(N):
   M[i] = max(M[i], n)
 return tuple(M)

def monomial_max ( * monoms ) : M = list ( monoms [ 0 ] ) for N in monoms [ 1 : ] : for ( i , n ) in enumerate ( N ) : M [ i ] = max ( M [ i ] , n ) return tuple ( M )
returns maximal degree for each variable in a set of monomials .