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)
Recommended Posts:
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Python | set() method
- Python | os.dup() method
- Python | next() method
- Python | os.dup2() method
- Python | sympy.gcd() method
- Python | sys.getdefaultencoding() method
- Python | sympy.Add() method
- Python | os.chown() method
- Python | os.fchown() method
- Python | os.lchown() method
- Python | Decimal ln() method
- Python | Tensorflow sin() method
- Python PIL | getbands() method
- Python | Tensorflow tan() method
- Python | Tensorflow cos() method
- Python | sympy.S() method
- Python | os.fchdir() method
- Python | sympy.lcm() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

