#!/usr/local/bin/python3 xxx = 10 xx = 1000 class Foo: print(xxx) xx = 100 print(xx) def foo(self): print(xxx) print(xx) foo = Foo() foo.foo()