`weights` is a numpy array of a certain number of values, which is being multiplied by x^i. ***Without summing the elements of `weights`***, how do I rewrite this function in a one line for loop?

```
x = np.array([0,1,2,3])
weights = np.zeros(order + 1)

def estimate(weights, x):
    est = 0
    for i in range(len(weights)):
        est += weights[i] * x ** i
    return est

estimate(weights, x)

```

I would like to rewrite this function in one line, such that:

```
est = [(est + (weights[i] * x ** i)) for i in range(len(weights))]

```

But this is not giving me the right output. What I don't understand is, why these two are not equivalent. How do you handle `+=` in a one line for loop? Is there maybe a different keyword that I could use that is eluding me right now?

---

EDIT: 
This is in fact the right answer:
`est = sum([(weights[i] * (x ** i)) for i in range(order + 1)])`
I had another bug in my code which prevented me from getting the correct result unrelated to this statement.
I apologize for all the trouble.