Python | sympy.integer_nthroot() method
With the help of sympy.integer_nthroot()
method, we can find the nth roots of a number that is passed as a parameter in the sympy.integer_nthroot()
method. It will return a tuple having two value one is root and the other is boolean value which shows that if the root is perfect or not.
Syntax : sympy.integer_nthroot(val)
Return : Return a tuple having root and boolean value.
Example #1 :
In this example we can see that by using integer_nthroot()
method, we are able to find the nth root of a number that is passed as parameters.
from sympy import *
gfg = integer_nthroot( 25 , 2 )
print (gfg)
|
Output :
(5, True)
Example #2 :
from sympy import *
gfg = integer_nthroot( 80 , 3 )
print (gfg)
|
Output :
(4, False)
Last Updated :
02 Aug, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...