Ask Your Question

Revision history [back]

Running

for i in range(n):
    pari('a[i]')

won't work since 'a[i]' is a string. Try something like this instead:

for i in range(n):
    pari('a[%d]' %(i))

This will actually substitute the values i takes on into the string expressions you want to evaluate.