[Tutor] Comparing two lists

Emile van Sebille emile at fenx.com
Thu Sep 16 21:44:55 CEST 2010


On 9/16/2010 11:27 AM Michael Powe said...
> Hello,
>
> I have two lists.
>
> alist = ['label', 'guid']
>
> blist = ['column0label', 'column1label', 'dimension0guid',
> 'description', 'columnid']
>

Something like this?

 >>> [ ii for jj in alist for ii in blist if jj in ii ]
['column0label', 'column1label', 'dimension0guid']

Emile



More information about the Tutor mailing list