fork(1) download
  1. class Point:
  2. def __init__(self, x, y):
  3. self.x = x
  4. self.y = y
  5. self.next = None
  6.  
  7. def append(self, point):
  8. self.next = point
  9.  
  10. a = Point(2, 3)
  11. b = Point(5, 7)
  12. a.append(b)
  13. print b.x
  14. print a.next.x
  15.  
  16. b.x = 6
  17. print b.x
  18. print a.next.x
  19.  
Success #stdin #stdout 0.08s 10928KB
stdin
Standard input is empty
stdout
5
5
6
6