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.



filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

True

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

False


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.