yo folks, I have an issue with clearing lists. In the current program which I'm coding, I have a method that clears a certain number of lists. 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 elementfrom the lists. Is there anyway in which I can set index numbers as parameters to my method to solve this problem?
The code for the method
def clearLists(self):
del self.Ans[:]
del self.masses[:]
Whenever I want to use this method, I merely write self.ClearLists() and it deletes every element in a list.
clearLists
? – Wooble Dec 2 '11 at 15:07