fork download
  1. class A():
  2. count=0
  3. def __init__(self):
  4. A.count += 1
  5. @classmethod
  6. def k(cls):
  7. print(A.count)
  8.  
  9. b=A()
  10. c=A()
  11. print(b.count)
  12. print(c.count)
Success #stdin #stdout 0.02s 9180KB
stdin
Standard input is empty
stdout
2
2