Python | sympy.is_algebraic method

With the help of sympy.is_algebraic method, we can check weather element is algebraic or not this method will return the boolean value i.e True or False.

Syntax : sympy.is_algebraic
Return : Return True if algebraic else False.

Example #1 :
In this example we can see that by using sympy.is_algebraic method, we are able to check the algebraic value and it will return a boolean value.



filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy
from sympy import * 
  
x = symbols('x')
  
# Use sympy.is_algebraic method
gfg = simplify(2 * x).is_algebraic
    
print(gfg)

chevron_right


Output :

True

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy
from sympy import *
  
# Use sympy.is_algebraic method
gfg = simplify(5I).is_algebraic
    
print(gfg)

chevron_right


Output :

False



My Personal Notes arrow_drop_up

Recommended Posts:



    Article Tags :

    Be the First to upvote.


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