I need to compare a string or list to another list of unwanted words to leave only the key words behind for example:
>filter_words(['how', 'about', 'i', 'go', 'through', 'that', 'little', 'passage', 'to', 'the', 'south'], skip_words)
>> Expected outcome ['go', 'passage', 'south']
This is needs to be compared to skip_words which is:
>skip_words = ['a', 'about', 'all', 'an', 'another', 'any', 'around', 'at',
'bad', 'beautiful', 'been', 'better', 'big', 'can', 'every', 'for',
'from', 'good', 'have', 'her', 'here', 'hers', 'his', 'how',
'i', 'if', 'in', 'into', 'is', 'it', 'its', 'large', 'later',
'like', 'little', 'main', 'me', 'mine', 'more', 'my', 'now',
'of', 'off', 'oh', 'on', 'please', 'small', 'some', 'soon',
'that', 'the', 'then', 'this', 'those', 'through', 'till', 'to',
'towards', 'until', 'us', 'want', 'we', 'what', 'when', 'why',
'wish', 'with', 'would']
This example uses a list of words rather than a basic string so this is more a preliminary function rather than the end result but I haven't been able to find a solution as of yet.