Open ARJhe opened 5 years ago
>>> class B():
・・・ count = 1
・・・ def __init__(self):
・・・ self.count += 1
・・・ def show_it(self):
・・・ print("I have ",self.count," object.")
・・・
>>> bird = B()
>>> B.count
1
>>> bird.count
2
>>> bird.show_it()
I have 2 object.
wrong way
correct way