input: Write a function to add and print nodes in a linked list.
  assert linked_list.addNode(1) == None
  assert linked_list.addNode(2) == None
  assert linked_list.printList() == None  # Output should be: 1 2
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def addNode(self, data):
          new_node = Node(data)
          if self.head is None:
              self.head = new_node
          else:
              last = self.head
              while last.next:
                  last = last.next
              last.next = new_node
  
      def printList(self):
          current = self.head
          while current:
              print(current.data, end=" ")
              current = current.next
          print()
  
  # Create instance of LinkedList
  linked_list = LinkedList()