I am using a list on which some functions works in my program. This is a shared list actually and all of my functions can edit it. Is it really necessary to define it as \"g
Yes, you need to use global foo if you are going to write to it.
global foo
foo = [] def bar(): global foo ... foo = [1]