title: how to print elements of a stack in python 3
body: <p>I have to print elements in a stack using classes and all:</p>
  
  <pre><code>class Stack:
  
      def __init__(self):
          self.stack = []
  
      def push(self,element):
          self.stack.append(element)
  
      def pop(self):
          return self.stack.pop()
  
  def st(n):
  
      s = Stack()
      for i in range(n,0,-1):
          s.push(i)
  
      #this is updated version now I want to print outside of the loop and 
      #it gives me this error : __main__.Stack instance at 0x7fe40d261710&gt; 
      print s
  if __name__ == '__main__':
  
     st(4)
  </code></pre>
  
  <p>for some reason instead of printing [4,3,2,1]
  it print None</p>