1 class A: 2 "A class with attribute and method." 3 x = 123 4 def m(self, x): 5 self.x = x 6 a = A() 7 y = A.x 8 a.m(321) 9 z = a.x