comparing two lists and returning "position"

Neil Cerutti horpner at yahoo.com
Thu Jun 21 23:38:11 EDT 2007


On 2007-06-22, hiro <NunezD at gmail.com> wrote:
> Hi there, I have a 2 lists.. for simplicities sake lets say the are:
>
> l1 = [ 'abc' 'ghi' 'mno' ]
>
> l2 = [ 'abc' 'def' 'ghi' 'jkl 'mno' 'pqr']
>
> what I need to do is compare l1 against l2 and return the "position"
> of where each object in l1 is in l2
>
> ie: pos = 0, 2, 4
>
> Thanks in advance, -h

Come, come! You can try harder than that.

-- 
Neil Cerutti



More information about the Python-list mailing list