title: stack function python error
body: <p>I created the following <code>stack</code> class for a project and am having trouble getting it to function properly. I can't tell if i made the error or it is an error in the main function i was given by my TA, anyways here is my code:</p>
  
  <pre><code>class Stack:
      #takes in the object as input argument
      #will not return anything 
      def __init__(self):
           #initialise an instance variable to an empty list.
           self.items=[]
  
      #takes in the object as input argument
      #return value Type: True or False
      def isEmpty(self):
           #check if the list is empty or not. If empty, return True else return False
           if self.items == []:
               return True
           else:
               return False
  
  
      #takes in the object as the first argument
      #takes the element to be inserted into the list as the second argument
      #should not return anything
      def push(self, x):
          #add the element to be inserted at the end of the list
          self.items.append(x)
      #takes in the object as the input argument
      #if the list is not empty then returns the last element deleted from the list. If the list is empty, don't return anything 
      def pop(self):
           #check if the list is Empty
           #if Empty: print the list is empty
           #if the list is not empty, then remove the last element from the list and return it 
           if self.isEmpty()==True:
               print("the list is empty")
           else:
             return self.items.pop()
       #takes in the object as the input argument
       #should not return anything
       def printContents(self):
            #if the list is not empty, then print each element of the list
            print("The content of the list is", self.items)
  </code></pre>
  
  <p>Based on the comments can anyone give me any advice on how I might make this work more appropriately? Sorry I am not a computer scientist and i am trying my hardest to understand classes and functions for my python class.</p>
  
  <pre><code>from stack import *
  
  def main():
      s = Stack()
      s.push(1)
      s.pop()
      s.pop()
      s.push(2)
      s.push(3)
      s.push(4)
      s.printContents()
  
   main()
  </code></pre>