input: Write a function in Python to implement a linked list using classes and provide a method to print the elements of the linked list. Include assertions to test the implementation.
  
  ### Input:
  None
  
  ### Output:
  class Node:
      """Node class to represent the node in a linked list"""
      def __init__(self, data):
          self.data = data
          self.next = None
  
  
  class LinkedList:
      """LinkedList class to represent the entire linked list"""
      def __init__(self):
          self.head = None
      
      def print_list(self):
          node = self.head
          while(node):
              print(node.data)
              node = node.next
  
  # Creating a linked list 
  linked_list = LinkedList()
  
  # Creating the nodes
  node1 = Node(1)
  node2 = Node(2)
  node3 = Node(3)
  
  # Linking the nodes
  linked_list.head = node1
  node1.next = node2
  node2.next = node3
  
  # Printing the linked list
  linked_list.print_list()
  
  assert linked_list.print_list() == [1, 2, 3]
  linked_list.head = node2
  assert linked_list.print_list() == [2, 3]
  linked_list.head = node3
  assert linked_list.print_list() == [3]
  linked_list.head = None
  assert linked_list.print_list() == []
output: def print_list(self):
      result = []
      node = self.head
      while node:
          result.append(node.data)
          node = node.next
      return result