Sunday, February 1, 2026
HomeLanguagesPython | sympy.integer_nthroot() method

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.




# import sympy
from sympy import *
  
# Using sympy.integer_nthroot() method
gfg = integer_nthroot(25, 2)
  
print(gfg)


Output :

(5, True)

Example #2 :




# import sympy
from sympy import *
  
# Using sympy.integer_nthroot() method
gfg = integer_nthroot(80, 3)
  
print(gfg)


Output :

(4, False)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32478 POSTS0 COMMENTS
Milvus
124 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12066 POSTS0 COMMENTS
Shaida Kate Naidoo
6987 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6918 POSTS0 COMMENTS