Ask Your Question

Revision history [back]

click to hide/show revision 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})