ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 Apr 2012 14:23:41 +0200global variableshttps://ask.sagemath.org/question/8838/global-variables/If I have a global variable N, how can i set N = smth inside of defined function?
def foo()
N = 10
doesn't change global N, because Sage makes N local variable.
Wed, 04 Apr 2012 08:37:24 +0200https://ask.sagemath.org/question/8838/global-variables/Answer by kcrisman for <p>If I have a global variable N, how can i set N = smth inside of defined function?</p>
<pre><code>def foo()
N = 10
</code></pre>
<p>doesn't change global N, because Sage makes N local variable.</p>
https://ask.sagemath.org/question/8838/global-variables/?answer=12125#post-id-12125Does any online documentation about Python global variables help? [Here](http://stackoverflow.com/questions/423379/using-global-variables-in-a-function-other-than-the-one-that-created-them) is a typical stackoverflow question about them...Wed, 04 Apr 2012 14:23:26 +0200https://ask.sagemath.org/question/8838/global-variables/?answer=12125#post-id-12125Comment by kcrisman for <p>Does any online documentation about Python global variables help? <a href="http://stackoverflow.com/questions/423379/using-global-variables-in-a-function-other-than-the-one-that-created-them">Here</a> is a typical stackoverflow question about them...</p>
https://ask.sagemath.org/question/8838/global-variables/?comment=19991#post-id-19991Not that you should necessarily make global variables in this way...Wed, 04 Apr 2012 14:23:41 +0200https://ask.sagemath.org/question/8838/global-variables/?comment=19991#post-id-19991