Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can declare a as a global variable:

def test2():
    global a
    a=1
    load("test.sage")

Remember that SageMath now is based on Python 3, so you should write print(a) if you use SageMath 9.0.