class Yep :
member = 999
def init(self):
self.member += 1
def getMember(self):
return self.member
def getYepMember(self):
return Yep.member
y1 = Yep()
y2 = Yep()
y1.init()
print(y1.member)
print(y1.getMember())
print(y1.getYepMember())
print("========================")
print(y2.member)
print(y2.getMember())
print(y2.getYepMember())
#输出:
1000
1000
999
========================
999
999
999