fork download
  1. class A:
  2. hui = 10
  3. def __init__(self, n):
  4. self.n = n
  5. def test(self):
  6. print(A.hui + self.n)
  7.  
  8. o1 = A(5)
  9. o2 = A(10)
  10. o1.test()
  11. o2.test()
Success #stdin #stdout 0.02s 9224KB
stdin
Standard input is empty
stdout
15
20