Ask Your Question

global variables

asked 2012-04-04 01:37:24 -0500

anonymous user


updated 2012-04-04 15:28:40 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-04-04 07:23:26 -0500

kcrisman gravatar image

Does any online documentation about Python global variables help? Here is a typical stackoverflow question about them...

edit flag offensive delete link more


Not that you should necessarily make global variables in this way...

kcrisman gravatar imagekcrisman ( 2012-04-04 07:23:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-04-04 01:37:24 -0500

Seen: 875 times

Last updated: Apr 04 '12