diff lists

Michael Hudson mwh21 at cam.ac.uk
Fri Mar 30 00:57:49 CEST 2001

Oliver Vecernik <vecernik at aon.at> writes:

> Hi,
> I've got following two lists:
> ['a', 'b', 'c', 'd', 'e', 'f']
> ['e', 'c', 'f']
> I'd like to have the result:
> ['a', 'b', 'd']
> The list need not to be ordered. ['d', 'a', 'b'] will also be ok. What
> is the most effective way to achive that result?

Tangentially, does anyone know of any good algorithms for "edit
distance" between two sequences?  E.g. if I have 


and want to get to


I want to get the answer back "insert 'QUACK' at position 3 and delete
a character at position 11".

"Good" means "pretty quick", here.


  If your telephone company installs a system in the woods with no
  one around to see them, do they still get it wrong?
                                 -- Robert Moir, alt.sysadmin.recovery

More information about the Python-list mailing list