Ask Your Question

Revision history [back]

As to the first question, use subs:

sage: def test(f,myvar,myval):
        return f.subs(myvar==myval)
....: 
sage: print(test(f,x,3))
9

In general, Sage comes with source, see https://github.com/sagemath/sage Regarding the plot question, the triple is a standard Python tuple. I would need a more specific question to elaborate further.

As to the first question, use subs:

sage: def test(f,myvar,myval):
        return f.subs(myvar==myval)
....: 
sage: f = x^2
sage: print(test(f,x,3))
9

In general, Sage comes with source, see https://github.com/sagemath/sage Regarding the plot question, the triple is a standard Python tuple. I would need a more specific question to elaborate further.