Ask Your Question

global variables

asked 2012-04-04 08:37:24 +0100

anonymous user


updated 2012-04-04 22:28:40 +0100

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 14:23:26 +0100

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 14:23:41 +0100 )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 08:37:24 +0100

Seen: 2,587 times

Last updated: Apr 04 '12