| 1 | initial version |
You could try with passing a dictionary to the .subs() method:
sage: def test(f,myvar,myval):
sage: return f.subs({myvar:myval})
sage: print(test(f,x,3))
9
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.