title: How could I generate random coefficients for polynomials using Sum( f(x), (x,0,b) )?
body: <pre><code>from sympy import Sum, Eq
  from sympy.abc import n,x
  import random
  def polynomial(x):
      i = 0
      def random_value(i):
          return random.choice([i for i in range(-10,10) if i not in [0]])
      eq = Sum(random_value(i)*x**n, (n,0,random_value(i)))
      display(Eq(eq,eq.doit(), evaluate=False))
  
  polynomial(x)
  polynomial(x)
  </code></pre>
  <p>With this code, the coefficients are always the same.</p>
  <p>Also, I am not sure if the algebra evaluations are correct for b &lt; 0 .</p>