I am trying to solve inequality using sympy symbols but I can't set an interval for my symbols, is there a way to do it???
import sympy as sy
p = sy.Symbol("p") # 0 < p < 1
f = p**2-1
if f < 0:
print("f is negative")
I am trying to solve inequality using sympy symbols but I can't set an interval for my symbols, is there a way to do it???
import sympy as sy
p = sy.Symbol("p") # 0 < p < 1
f = p**2-1
if f < 0:
print("f is negative")
Copyright © 2021 Jogjafile Inc.
If you replace
xwith an expression that has the range you are interested in then you can see that the relationship is true: