a guest Aug 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import sympy
- from sympy import poly
- x = sympy.Symbol('x') # Create a symbol x
- coefficients = [1,-2,5] # Your coefficients a python list
- p1 = sum(coef*x**i for i, coef in enumerate(reversed(coefficients))) # expression to generate a polynomial from coefficients.
- print p1 # print(p1), depending on your python version
RAW Paste Data