title: Stack and queue error in my program
body: <p>I'm trying to sort out my program from 2 hours, But every time i'm getting the same error. </p>
  
  <p>I'm working on <code>Stack, Queue and Linked List</code> program using python.</p>
  
  <p>Please help me, Whats wrong here in my code?</p>
  
  <pre><code>import random
  
  class Node(object):
  
      def __init__(self, other=None):
          self.other = other
          self.next = next
          self.previous = previous
  
      def __str__(self):
          return str(self.other)
  
  class List(object):
  
      def __init__(self):
          self.head = None
          self.tail = None
  
      def append(self, value):
          newNode = Node(value)
  
          if self.head == None:
              self.head = newNode
              self.tail = newNode
  
          else:
              self.tail.next = newNode
              newNode.previous = self.tail
              self.tail = newNode
  
      def __str__(self):
          someString = ""
          current = self.head
          while current != None:
              someString = someString + current.other
              current = current.next
              return someString
  
  class Queue(List):
  
      def enqueue(self, value):
          self.append(value)
  
      def dequeue(self):
          self.temp = self.head
          self.head = self.head.next
          return temp
  
  class Stack(List):
  
      def push(self, value):
          self.append(value)
  
      def pop(self):
          self.temp = self.tail
          self.tail = self.tail.previous
          return self.temp
  
  def main():
  
      list1 = List()
      for i in range(0, 100):
          list1.append(str(random.randrange(0, 100)))
          print(list1)
  
      queue = Queue()
      for i in range(0, 100):
          queue.enqueue(str(random.randrange(0, 100)))
  
      for i in range(0, 100):
          print(queue.dequeue)
  
      for i in range(0, 10):
          print("----------------------------------------")
          stack = Stack()
      for i in range(0, 100):
          stack.push(str(random.randrange(0, 100)))
  
      for i in range(0, 100):
          print(stack.pop())
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p><strong>Here is Screenshot of my output:</strong></p>
  
  <p><a href="http://i.stack.imgur.com/4Kiwq.png" rel="nofollow">SCREENSHOT</a></p>
  
  <p>Help would be appreciated!!</p>