Compare List Similarity Python
Question: 
    S = ['hom']
    L = ['home','honda','Hammer','Elephant']
    

I want to get output to show similarity

    
    
    hom = home 
    

and

    
    
    print home
    

How I can do this? I want to use approximate matching to change "hom" to
"home".


Answer: For something built-in, you have
[difflib](http://docs.python.org/library/difflib.html).

It can (as said in the docs): Return a list of the best “good enough” matches.
word is a sequence for which close matches are desired (typically a string),
and possibilities is a list of sequences against which to match word
(typically a list of strings).

The example in the docs is:

    
    
    >>> from difflib import get_close_matches
    >>> get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'])
    ['apple', 'ape']
    

