a = 1 def foo(): print a a = 2 print a foo()