A list comprehension is a shorter version of this loop:
new_list = []
for i in colors:
if 'een' not in i:
new_list.append(i)
Here is the list comprehension equivalent:
new_list = [i for i in colors if 'een' not in i]
You can also use the filter example, like this:
>>> filter(lambda x: 'een' not in x, colors)
['red', 'blue', 'purple']
Keep in mind this won't change the original colors
list, it will just return a new list with only the items that match your filter. You can remove the items that match which will modify the original list, however you need to start from the end to avoid problems with consecutive matches:
for i in colors[::-1]: # Traverse the list backward to avoid skipping the next entry.
if 'een' in i:
colors.remove(i)