Python | sympy.is_nonpositive() method
Last Updated :
25 Aug, 2021
In simpy module, we can test whether a given number n is non-positive or not using sympy.is_nonpositive() function
Syntax: sympy.is_nonpositive(n)
Parameter: n; number to be tested
Return: bool value result
Code #1:
Python3
from sympy import *
geek1 = simplify( - 21 ).is_nonpositive
geek2 = simplify( 0 ).is_nonpositive
print (geek1)
print (geek2)
|
Output:
True
False
Code #2:
Python3
from sympy import *
geek = simplify( - 002 ).is_nonpositive
print (geek)
|
Output:
True
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...