| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.