Apr-13-2018, 09:30 PM
If you are willing to install an external library, or are working with large integer numbers, you should look at
gmpy2
>>> import gmpy2 >>> gmpy2.iroot_rem(128,3) (mpz(5), mpz(3))
iroot_rem(x,N)
returns the integer part of the N-th of x and the remainder.