Friday, October 17, 2025
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
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS