fork download
  1. class C(object):
  2. def __init__(self, v):
  3. self.value = v
  4. def show(self):
  5. print(self.value)
  6. def getValue(self):
  7. return self.value
  8. def setValue(self, v):
  9. self.value = v
  10. c1 = C(10)
  11. print(c1.getValue())
  12. c1.setValue(20)
  13. print(c1.getValue())
Success #stdin #stdout 0.02s 8696KB
stdin
Standard input is empty
stdout
10
20