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