Ask Your Question

Revision history [back]

Instead of passing variables[0] as the name of an argument, you can pass a dictionary as an argument of subs method:

sage: R.<x,y> = PolynomialRing(QQ,2)
....: f = x^2+y^2
....: variables = [x,y]
....: f.subs({variables[0]:1})
y^2 + 1