Python | sympy Relational() method Last Updated : 13 Aug, 2019 Improve Improve Like Article Like Save Share Report 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. Example #1 : 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) Like Article Suggest improvement Next Python | sympy.Rational() method Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads Python | Relational fields in Django models Python | Sympy Line.is_parallel() method Python | sympy.GreaterThan() method Python | sympy.StrictLessThan() method Python | sympy.LessThan() method Python | sympy.StrictGreaterThan() method Python | sympy.ones() method Python | sympy.zeros() method Python | sympy.eye() method Python | Sympy Ellipse.equation() method Like J Jitender_1998 Follow Article Tags : SymPy Python Practice Tags : python