title: Error when creating a LinkedList
body: <p>So for data structure practice in different languages, I decided to create a Linked List in python.</p>
  
  <p>Now here is my code so far, it is still far from done, but I've encountered this error and I cant seem to point out to myself where it is coming from:</p>
  
  <pre><code>class LinkedNode:
      def __init__(self, value):
          self.value = value
          self.nextNode = None
  
  class LinkedList:
      def __init__(self):
          self.headNode = None
  
      def isEmpty(self):
          return self.headNode == None
  
      def addToHead(self, value):
          head = LinkedNode(value)
  
      def removeFromHead(self):
          head = self.headNode
          self.headNode = self.headNode.nextNode
          return head
  
      def addToTail(self, value):
          if self.headNode == None:
              self.addToHead(value)
          else:
              tmp = self.headNode
              while tmp.nextNode != None:
                  tmp = tmp.nextNode
              tmp.nextNode = LinkedNode(value)
  
      def empty(self):
          self.headNode = None
  
      def contains(self, value):
          tmp = self.headNode
          while tmp.nextNode != None:
              if tmp.value == value:
                  return true
              tmp = tmp.nextNode
          return False
  
      def toString(self):
          tmp = self.headNode
          buffer = '['
          while tmp.nextNode != None:
              buffer = buffer + str(tmp.value) + ', '
              tmp = tmp.nextNode
          buffer = buffer + ']'
  
  list = LinkedList()
  list.addToHead(1)
  list.addToHead(2)
  list.addToTail(3)
  list.toString()
  </code></pre>
  
  <p>Here is the error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):</p>
    
    <p>File "path/linkedList.py", line 52, in 
        list.toString()</p>
    
    <p>File "path/linkedList.py", line 44, in toString</p>
  
  <pre><code>while tmp.nextNode != None:
  </code></pre>
    
    <p>AttributeError: 'NoneType' object has no attribute 'nextNode'
    [Finished in 0.138s]</p>
  </blockquote>