input: Write a function to traverse and collect data from a linked list.
  assert traverse_linked_list(Node(1).add(Node(2).add(Node(3)))) == [1, 2, 3]
  assert traverse_linked_list(Node(10).add(Node(20).add(Node(30).add(Node(40))))) == [10, 20, 30, 40]
  assert traverse_linked_list(Node(5).add(Node(15).add(Node(25)))) == [5, 15, 25]
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
      def add(self, node):
          self.next = node
          return self
  
  def traverse_linked_list(head):
      result = []
      current = head
      while current:
          result.append(current.data)
          current = current.next
      return result