newbie list question

Kamus of Kadizhar yan at NsOeSiPnAeMr.com
Sat Dec 6 07:42:44 EST 2003


Paul Rubin wrote:
> Kamus of Kadizhar <yan at NsOeSiPnAeMr.com> writes:
> 
>>I want to remove those elements that are in the sub-lists of fav that
>>also appear in the corresponding sub-list of oldfav:
>>
>>I can hack this up using C-style indexes, but I have to imagine there
>>is some neat python way that eliminates indexes altogether.
> 
> 
> Does this work?
> 
> difffav = [[f for f in new if f not in old] for new,old in zip(fav,oldfav)]

Yes it does.  But I have no idea how.  :-(

I think it's going to take me a while to figure out what the above 
does....  :-)  Where do I find that in the FM?

-Kamus

-- 
What am I on?
I'm on my bike,                         o__
6 hours a day, busting my ass.          ,>/'_
What are you on? --Lance Armstrong     (_)\(_)





More information about the Python-list mailing list