First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 8 years ago

nbruin gravatar image
sage: function('f')(*(SR.symbol("x%s"%i) for i in range(n)))
f(x0, x1, x2)
click to hide/show revision 2
No.2 Revision

There's a python trick to unpack an iterable into an argument list in a function call:

sage: function('f')(*(SR.symbol("x%s"%i) for i in range(n)))
f(x0, x1, x2)