title: How to write pop(item) method for unsorted list
body: <p>I'm implementing some basic data structures in preparation for an exam and have come across the following issue. I want to implement an unsorted linked list, and have already implemented a <code>pop()</code> method, however I don't know, either syntactically or conceptually, how to make a function sometimes take an argument, sometimes not take an argument. I hope that makes sense.</p>
  
  <pre><code>def pop(self):
      current = self.head
      found = False
      endOfList = None
  
      while current != None and not found:
          if current.getNext() == None:
              found = True
              endOfList = current.getData()
              self.remove(endOfList)
              self.count = self.count - 1
          else:
              current = current.getNext()
  
      return endOfList
  </code></pre>
  
  <p>I want to know how to make the statement <code>unsortedList.pop(3)</code> valid, 3 being just an example and unsortedList being a new instance of the class.</p>