1 | initial version |
The simplest solution is just to use dictionary arguments for subs.
Instead of
for counter in range(1,n):
f = f.subs(var('x' + str(counter))=counter)
which throws a SyntaxError, you can write
for counter in range(1,n):
f = f.subs({var('x' + str(counter)):counter})