title: Python: inserting an item to the stack
body: <p>I tried to insert an item into the stack but the size is still empty is the input inserted into the stack in this case?</p>
  
  <p>Overtime i obtain the size of the stack/list it is Empty</p>
  
  <pre><code>def main_menu():
          print('\nMenu:')
          print('1. Push')
  
          the_stack = Stack()
  
          while True:
                  try:
                      command = int(input("\nEnter command:"))
                      if command == 1:
                          try:
                              ask = int(input("\nEnter an integer:"))
                              the_stack = Stack()
                              the_stack.push(ask)
                              print("item pushed")
                              print(the_stack.peek())
  
                          except ValueError:
                              print ("Enter Integer numbers only")
                  except ValueError:
                      print ('Please input a Number only')
                  else:
                      if 1 &lt;= command &lt; 5:
                          break
                      else:
                          print ('Enter command from 1 to 4 only')
  
  class Node:
      """
      The Node used for Linked List
      """
      def __init__(self, item, link):
          self.item = item
          self.next = link
  
  class Stack:
  
      def push(self, item):
          self.top = Node(item, self.top)
  
  if __name__ == '__main__':
      main_menu()
      the_stack = Stack()
  </code></pre>