input: Write a function to implement a linked list using classes in Python. The function should define two classes: Node and LinkedList. The Node class should have an __init__ method to initialize the data and next attributes, and the LinkedList class should have an __init__ method to initialize the head attribute and a print_list method to print the data of each node in the linked list.
  assert Node(1).data==1
  assert Node(1).next==None
  assert LinkedList().head==None
  
  # 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
  output = []
  node = linked_list.head
  while(node):
      output.append(node.data)
      node = node.next
  assert output==[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):
          node = self.head
          while node:
              print(node.data)
              node = node.next