fork download
  1. class Cs:
  2. count = 0
  3. def __init__(self):
  4. Cs.count = Cs.count + 1
  5. @classmethod
  6. def getCount(cls):
  7. return Cs.count
  8. i1 = Cs()
  9. i2 = Cs()
  10. i3 = Cs()
  11. i4 = Cs()
  12. print(Cs.getCount())
  13.  
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
4