title: Linked List in Python- Append, Index, Insert, and Pop functions. Not sure with code/errors
body: <p>This assignment asks us to implement the append, insert, index and pop methods for an unordered linked-list.
  (What I have so far)</p>
  
  <pre><code>    def main():
  class Node:
      def __init__(self, data):
          self.data = data
          self.next_node = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
          self.tail = None
  
      def AppendNode(self, data):
          new_node = Node(data)
  
          if self.head == None:
              self.head = new_node
  
          if self.tail != None:
              self.tail.next = new_node
  
          self.tail = new_node
      def PrintList( self ):
          node = self.head
  
          while node != None:
              print (node.data)
              node = node.next
  
      def PopNode( self, index ):
          prev = None
          node = self.head
          i = 0
  
          while ( node != None ) and ( i &lt; index ):
              prev = node
              node = node.next
              i += 1
  
          if prev == None:
              self.head = node.next
          else:
              prev.next = node.next
  
  list = LinkedList()
  list.AppendNode(1)
  list.AppendNode(2)
  list.AppendNode(3)
  list.AppendNode(4)
  list.PopNode(0)
  list.PrintList( )
  </code></pre>
  
  <p>The output so far:</p>
  
  <pre><code>    2
      3
      4
      Traceback (most recent call last):
        File "&lt;pyshell#32&gt;", line 1, in &lt;module&gt;
          main()
        File "&lt;pyshell#31&gt;", line 50, in main
          list.PrintList( )
        File "&lt;pyshell#31&gt;", line 27, in PrintList
          node = node.next
      AttributeError: 'Node' object has no attribute 'next'
  </code></pre>
  
  <p>I'm not sure why i'm getting the errors, since the code is technically working. Also any input on the insert, and index functions would be greatly appreciated. </p>