[Tutor] Global Variables

Steven D'Aprano steve at pearwood.info
Sat Jun 22 10:50:17 CEST 2013


On 22/06/13 18:09, Jack Little wrote:
> Is there a way to keep a global throughout multiple def statements?

I don't understand the question. The only way to *not* keep a global through multiple def statements is if you delete the global:


x = 1  # Global.

def function_one():
     code goes here...

def function_two():
     code goes here...

del x

def function_three():
     code goes here...


But I suspect that this is not what you mean. Can you explain in more detail what you mean?




-- 
Steven


More information about the Tutor mailing list