how to remove multiple occurrences of a string within a list?

bahoo b83503104 at yahoo.com
Tue Apr 3 14:20:33 EDT 2007


Hi,

I have a list like ['0024', 'haha', '0024']
and as output I want ['haha']

If I
myList.remove('0024')

then only the first instance of '0024' is removed.

It seems like regular expressions is the rescue, but I couldn't find
the right tool.

Thanks!
bahoo




More information about the Python-list mailing list