input: Write a function to get the middle of a linked list.
  assert getmiddle([1, 2, 3, 4, 5]).data == 3
  assert getmiddle([10, 20, 30, 40, 50, 60]).data == 30
  assert getmiddle([7, 14, 21, 28]).data == 21
output: class ListNode:
      def __init__(self, data=0, next=None):
          self.data = data
          self.next = next
  
  def getmiddle(head):
      if not head:
          return None
  
      slow = head
      fast = head
  
      while fast and fast.next:
          slow = slow.next
          fast = fast.next.next
  
      return slow
  
  # Helper function to create a linked list from a list and return the head node
  def create_linked_list(lst):
      if not lst:
          return None
      head = ListNode(lst[0])
      current = head
      for value in lst[1:]:
          current.next = ListNode(value)
          current = current.next
      return head
  
  # Creating linked lists and testing the assertions
  assert getmiddle(create_linked_list([1, 2, 3, 4, 5])).data == 3
  assert getmiddle(create_linked_list([10, 20, 30, 40, 50, 60])).data == 30
  assert getmiddle(create_linked_list([7, 14, 21, 28])).data == 21