class Wall:
#存储墙方块列表
wall_list=[]
def init(self):
wall_list.append(self)
class wall:
wall_list = []
def __init__(self, n):
self.n = n
wall.wall_list.append(self)
def pri(self):
print(self.n)
@classmethod
def show(cls):
for _ in cls.wall_list:
print(_.n)
w1 = wall('w11')
w2 = wall('w22')
w1.pri()
w2.show()