I am trying to solve a simple equation, but this is what is being outputted:
the equation is y = m*x + b
,
y
, m
, and b
are already defined
I would like to print b
.
import sympy
while True:
x1 = int(input('x1: '))
y1 = int(input('y1: '))
x2 = int(input('x1: '))
y2 = int(input('y1: '))
m = (y1-y2) / (x1-x2)
print(m)
m = sympy.symbols('m')
x = sympy.symbols('x')
y = sympy.symbols('y')
b = sympy.symbols('b')
a = y, x*m + b
print(sympy.solve(a, b))