1 class A: 2 "A class with attribute and method." 3 x = 123 4 def m(self, x): 5 self.x = x 6 def n(self, y=x): 7 self.y = y 8 9 a1 = A() 10 a2 = A() 11 y = A.x 12 a1.m(321) 13 a2.m("321") 14 z1 = a1.x 15 z2 = a2.x 16 a1.n(123) 17 a2.n("123") 18 a2.n()