Jul-10-2022, 05:57 PM
The set() approach will only find matching words if there are matches to be found. "tomato" does not match "Tomato", nor does it match "tomatoes" or "I like that with tomato please". Verify that "words" is a list of words and not a string that contains words.
My "any" example finds substrings in a word, not words in a list. It is not directly applicable to your problem, but it does a nice job demonstrating how "any" works.
My "any" example finds substrings in a word, not words in a list. It is not directly applicable to your problem, but it does a nice job demonstrating how "any" works.