SHARE
TWEET

Untitled

a guest Aug 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sympy
  2. from sympy import poly
  3.  
  4. x = sympy.Symbol('x') # Create a symbol x
  5.  
  6. coefficients = [1,-2,5] # Your coefficients a python list
  7.  
  8. p1 = sum(coef*x**i for i, coef in enumerate(reversed(coefficients))) # expression to generate a polynomial from coefficients.
  9.  
  10. print p1 # print(p1), depending on your python version
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top