fork download
  1. class test:
  2. def __init__(self, x, y):
  3. self.x = x
  4. self.y = y
  5. def get_sum(self):
  6. return self.x + self.y
  7.  
  8. object = test(10, 20)
  9.  
  10. print(object.get_sum())
  11. print(test.get_sum(object))
  12.  
  13.  
Success #stdin #stdout 0.02s 9180KB
stdin
Standard input is empty
stdout
30
30