First time here? Check out the FAQ!
answered 2016-08-12 02:32:56 +0100
You can save your file with the .sage extension and then load it in Sage using load('myfile.sage'). Then, your function should work as you have written it.
.sage
load('myfile.sage')