Possible Duplicate:
Remove all occurences of a value from a Python list
mylist = ['dogs', 'cats', 'cats']
If I type mylist.remove('cats')
, it deletes only one cats in my list, but I want to delete all cats in my list without loops, because loops are going to crash the way I want to.
EDIT: it's a little trick to explain, for example, it's going to crash because I'm trying to develop a module to remove equal elements from a list. mylist[i] returns dogs firstly, I delete it, but after another loop, mylist[i] doesn't return dogs anymore, but cats. That's why I want to delete all instances in a single statement regardless of the index loop.