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