I want to find the greatest integer less than or equal to the kth root of n. I tried
int(n**(1/k))
But for n=125, k=3 this gives the wrong
def nthrootofm(a,n): a= pow(a,(1/n)) return 'rounded:{},'.format(round(a)) a=125 n=3 q=nthrootofm(a,n) print(q)
just used a format string , maybe this helps.