For context: Users can add items to a list. I want to remove all identical submissions. Is there a more efficient way to do this:?
def removeCopies(self):
i = 0
while i != self.size:
number = self.contents.count(self.contents[i])
if number != 1:
for j in range(1, number):
self.delete(self.contents.index(self.contents[i], i + 1))
i += 1