input: Write a python function to delete a node at a given index in a linked list.
  assert llist.delete_node(2) == [1, 2, 4]
  assert llist.delete_node(0) == [2, 4]
  assert llist.delete_node(10) == [1, 2, 3, 4]
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def append(self, new_data):
          new_node = Node(new_data)
          if self.head is None:
              self.head = new_node
              return
          last = self.head
          while last.next:
              last = last.next
          last.next = new_node
  
      def to_list(self):
          node = self.head
          nodes = []
          while node:
              nodes.append(node.data)
              node = node.next
          return nodes
  
      def delete_node(self, position):
          if self.head is None:
              return []
          
          temp = self.head
  
          if position == 0:
              self.head = temp.next
              temp = None
              return self.to_list()
  
          for i in range(position - 1):
              temp = temp.next
              if temp is None:
                  return self.to_list()
  
          if temp is None or temp.next is None:
              return self.to_list()
  
          next = temp.next.next
          temp.next = None
          temp.next = next
  
          return self.to_list()
  
  llist = LinkedList()
  for i in [1, 2, 3, 4]:
      llist.append(i)