Invalid syntax in a variable in Python : <p>The code is below</p>

<pre><code>i=0
a=0
Matrix[0]=0
Matrix = [1 for i in range(1000)]
while i&lt;1000:
    i=i+1
    Matrix[i]=(1/1000)*((i*(1/1000))^2
    a=a+Matrix[i]
print (a)
</code></pre>

<p>When I try to run the program, Python highlight the first a in the 8th row and it says invalid syntax.
I can't figure out what is the problem with the code.
<br>Much appreciated if you helped</p>
