input: Write a function to implement a linked list using classes in Python. The function should include a Node class to represent each node in the linked list and a LinkedList class to represent the entire linked list. The LinkedList class should have a method to print the elements of the list. If the linked list is empty, the method should not print anything. Include assert statements to test the implementation.
  assert linked_list.print_list()
  node1 = Node(1)
  node2 = Node(2)
  node3 = Node(3)
  linked_list.head = node1
  node1.next = node2
  node2.next = node3
  assert linked_list.print_list() == [1, 2, 3]
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def print_list(self):
          elements = []
          current = self.head
          while current:
              elements.append(current.data)
              current = current.next
          return elements