Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Usually my preferred way to do something like this is use a string formatting substitution. There may be an open ticket for making such things easier, but for now I'd do

sage: for k in range(1001):
    function('f_%s'%k,nargs=1)

The percent signs are telling you to append a string, and that the string will the string from the int k, respectively.

I don't think you have to use the f=function('f') syntax in this case; someone correct me if that's not true.