Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I make a python function return a polynomial?

I have a file ~/foo.py

from sage.all import *


def my_func(n):
    var('t') 
    f(t) = t**n 
    return f(t)

But issuing sage: import foo raises the error SyntaxError: can't assign to function call

What am I doing wrong?