Symbolic Python Ass #4
https://ibb.co/5631sdh
import sympy
sympy.init_printing()
x, y, z = sympy.symbols('x,y,z')
# example math expression
expression = x**2 + 5*x -7
print(expression.subs(x, 1.5))
print(expression.subs(x, y))
print(expression.subs(x, z**2))
Comments
Leave a comment