Python | sympy.is_zero() method

In simpy module, we can test whether a given number n is zero or not using sympy.is_zero() function.

Syntax:  sympy.is_zero(n)
Parameter:  n; number to be tested
Return:  bool value result 
Code #1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program to check zero 
# using sympy.is_zero() method
  
# importing sympy module
from sympy import *
  
# calling is_zero function on differnet numbers
geek1 = simplify(1).is_zero
geek2 = simplify(0).is_zero
  
print(geek1)
print(geek2)

chevron_right


Output:

False
True

Code #2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python program to check zero number
# using sympy.is_zero() method
  
# importing sympy module
from sympy import *
  
# calling is_zero function on differnet numbers
geek = simplify(002).is_zero
  
print(geek)

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.