alexgonzalez February 2016
### how to solve math variable in python? having trouble with =

# I want to solve for x

h = 10 w = 550

(8 * x) + (h - 8) * (x * 1.5) = w

# then i want to print answer

print answer

if you just need to solve you can always use sympy (but i suspect you are looking for something else)

```
>>> from sympy.solvers import solve
>>> from sympy import Symbol
>>> x=Symbol('x')
>>> h,w=10,550
>>> eqn = 8*x + (h-8)*(x*1.5) - w
>>> solve(eqn,x)
```

Asked in February 2016

Viewed 1,030 times

Voted 11

Answered 1 times

Viewed 1,030 times

Voted 11

Answered 1 times