input: Write a class to create a linked list in Python using nodes. The class should have an `__init__` method that initializes the node with data and sets the next node to None. Additionally, the class should provide a method to connect nodes to create a list.
  class ListNode:
      def __init__(self, data):
          self.data = data
          self.next = None
  
      def connect(self, next_node):
          self.next = next_node
  
  assert ListNode(1).data == 1
  assert ListNode(2).next == None
  node1 = ListNode(1)
  node2 = ListNode(2)
  node1.connect(node2)
  assert node1.next.data == 2
output: def __init__(self, data):
      self.data = data
      self.next = None
  
  def connect(self, next_node):
      self.next = next_node