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

kcrisman gravatar image

To do optional arguments in Python (and hence, Sage), the idiom is something like

def f(a=2,b=3,*args):
    <function definition>
    first_optional_argument = args[0]
    <etc>

where args then becomes a list of the optional arguments. See much more detailed stuff: