Sunday, November 17, 2024
Google search engine
HomeLanguagesPython | sympy.ntheory.primetest.is_square() method

Python | sympy.ntheory.primetest.is_square() method

With the help of sympy.ntheory.primetest.is_square() method, we can find that weather an integer is perfect square or not that is passed as a parameter in the sympy.ilcm() method and returns a boolean value.

Syntax : sympy.ntheory.primetest.is_square(val)
Return : Return boolean value.

Example #1 :
In this example we can see that by using sympy.ntheory.primetest.is_square() method, we are able to find that weather an integer if perfect square or not that is passed as parameters.




# import sympy
from sympy.ntheory.primetest import is_square
  
# Using sympy.ntheory.primetest.is_square() method
gfg = is_square(16)
  
print(gfg)


Output :

True

Example #2 :




# import sympy
from sympy.ntheory.primetest import is_square
  
# Using sympy.ntheory.primetest.is_square() method
gfg = is_square(24)
  
print(gfg)


Output :

False

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments