I have two lists, I want to compare one list with the other and get all the close matches as output for each word.
For example:
a = ['apple','python','ice-cream']
b = ['aaple','aple','phython','icecream','cat','dog','cell']
so when I pass the list 'a' i need to get 'aaple','aple','phython','icecream' as outputs from 'b'.
I used difflib.get_close_matches(word,pattern), but couldn't pass the whole list in one of the inputs.
difflib.get_close_matches('apple',b)
OUTPUT:
['aaple','aple']
How can I pass the whole list instead of just a single word?