I read this in how to remove element as I traverse a list: Remove elements as you traverse a list in Python
Use this as an example:
>>> colors=['red', 'green', 'blue', 'purple']
>>> filter(lambda color: color != 'green', colors)
['red', 'blue', 'purple']
But how can I do that if i want to remove the element if it is part of a string? i.e I want to filter 'green' if I input just 'een' (just part of 'green' string element in colors?