In python you have built-in functions that operate on lists such as list.remove()
and list.pop()
.
Can you make your own custom functions that do this? I want to be able to do this:
def removeAll(self,value):
while value in self:
self.remove(value)
list = ["1","2","3","3","4","3","5"]
list.removeAll("3")
print(list)
#Outputs '["1","2","4","5"]
Just an example.