With the help of sympy.core.relational.Relational() method, we are going make the relations between two variables and constants by using sympy.core.relational.Relational() method.
Syntax :
sympy.core.relational.Relational(var1, var2, "rel")Return : Return a relationship between two variables.
In this example we can see that by using
sympy.core.relational.Relational() method, we are able to create the relationship between two variables.
# import sympy and Relational from sympy.core.relational import Relational from sympy import *Â Â Â x, y = symbols('x y') Â Â # Using sympy.core.relational.Relational(var1, var2, "rel") method gfg = Relational(x, y, ">=") Â Â print(gfg) |
Output :
x >= y
Example #2 :
# import sympy and Relational from sympy.core.relational import Relational from sympy import *Â Â Â x, y = symbols('x y') Â Â # Using sympy.core.relational.Relational(var1, var2, "rel") method gfg = Relational(x, y, "!=") Â Â print(gfg) |
Output :
Ne(x, y)
<!–
–>











Please Login to comment…