def _deg(f):
 k = f.ring.ngens
 degf = ((0,) * (k - 1))
 for monom in f.itermonoms():
  if (monom[:(-1)] > degf):
   degf = monom[:(-1)]
 return degf

def _deg ( f ) : k = f . ring . ngens degf = ( ( 0 , ) * ( k - 1 ) ) for monom in f . itermonoms ( ) : if ( monom [ : ( - 1 ) ] > degf ) : degf = monom [ : ( - 1 ) ] return degf
compute the degree of a multivariate polynomial f in k[x_0 .