Rares Vernica wrote:

> I have the following problem:
> 
> I have a list like
>    e = ['a', 'b', 'e']
> and another list like
>    l = ['A', 'a', 'c', 'D', 'E']
> I would like to remove from l all the elements that appear in e 
> case-insensitive. That is, the result would be
>    r = ['c', 'D']
> 
> What is a *nice* way of doing it?

r = [i for i in e if i not in l]

or use sets.

</F>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to