def modular_exp(base, exponent, modulus):
 if (exponent < 0):
  raise NegativeExponentError(('Negative exponents (%d) not allowed' % exponent))
 return pow(base, exponent, modulus)

def modular_exp ( base , exponent , modulus ) : if ( exponent < 0 ) : raise NegativeExponentError ( ( 'Negative exponents (%d) not allowed' % exponent ) ) return pow ( base , exponent , modulus )
raise base to exponent .