title: List method to delete last element in list as well as all elements
body: <p>I have an issue with clearing <code>list</code>s. In the current program, I have a method that clears a certain number of <code>list</code>s. This is rather inconvenient since during one part of the program where this method is used, it would be a lot more helpful if it only deleted the last element from the lists. Is there any way in which I can set index numbers as parameters to my method to solve this problem? </p>
  
  <p>The code for the method</p>
  
  <pre><code>def clearLists(self):
      del self.Ans[:]
      del self.masses[:]
  </code></pre>
  
  <p>Whenever I want to use this method, I merely write <code>self.ClearLists()</code> and it deletes every element in a list.</p>