Ask Your Question

Revision history [back]

To actually return a value you need to use the keyword return

def f():
    return 3

Then you can do

sage: f()
3
sage: a = f()
sage: a
3

To actually return a value you need to use the keyword return as in

def f():
    return 3

Then With the above example you can do

sage: f()
3
sage: a = f()
sage: a
3