How to solve equations with Python
Let's install Sympy, a module to solve equations:- open cmd (windows button + r)
- digit cmd
- in cmd digit: pip install Sympy
Once you installed Sympy, close the cmd, open it again, digit python.
Now that you have the python interpreter opened, digit this:
>>> import sympy
>>> x = sympy.Symbol('x')
Now, let's make an example of how to solve an equation like this:
>>> sympy.solve(x**2+5*x-6)
[-6,1]
Comments
Post a Comment