I have an issue with clearing
lists. In the current program, 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 element from the lists. Is there any way 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.
you can use