define list in global python code example Example: global list python x = 0 def f(): x = 1 f() print x #=>0