I want to check if a word is in a list of words.
word = \"with\" word_list = [\"without\", \"bla\", \"foo\", \"bar\"]
I tried if word
if word
You could do:
found = any(word in item for item in wordlist)
It checks each word for a match and returns true if any are matches