| 1 | initial version |
To declare a function you can just follow this scheme
def function_name(<arguments>):
"Optional documentation string."
<Python/Sage instructions, could be multiple lines of code>
return <variable/expression>
In your case, I guess you'd like to receive G as an argument, so it could be of the form
def ihara( G ):
<your source code here>
return Z
For more details on functions you can consult this webpage.
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.