import sympy as s
s.init_printing()
x = s.Symbol('x')
y = s.Symbol('y')
2 * x + y + y
t = (x + y)**17
t
t.expand()
s.printing.ccode(t.expand())
t
c = t.subs(x, 3).subs(y, -1/2)
c
type(c)
type(int(c))
float(c)
c.evalf(50)
p = s.pi
p
float(p)
p.evalf(500)
from sympy import limit, sin, oo
oo
limit(1/x, x, 0)
limit(sin(x)/x**2, x, 0)
from sympy import series
series(sin(x)/x, x, 0)
from sympy import integrate
a, b = s.symbols('a, b')
integrate(2*x, (x, 0.1, 2))
r = (x + 2)*(x - a)
r.expand()
s.solve(r, x)