fork download
  1. class point:
  2. def __init__(self, x, y):
  3. self.x = x
  4. self.y = y
  5. def sum(self):
  6. return self.x + self.y
  7. a = point(3, 4)
  8. print(a)
  9. print(a.x, a.y)
  10. print(a.sum())
Success #stdin #stdout 0.02s 9124KB
stdin
Standard input is empty
stdout
<__main__.point object at 0x2ad956906eb8>
3 4
7