How to check whether a word from the list in the line?

How to check whether a word from the list in the line? Type
list = list()
spisok.append('word')
string = 'word in the world'
if 'word' in string:
 print ('yes)
June 14th 19 at 18:18
3 answers
June 14th 19 at 18:20
if the substring, not word (substring without spaces and characters), we find != -1
June 14th 19 at 18:22
list = list()
spisok.append('word')
string = 'word in the world'
for word in list:
 if word in string:
 print ('yes')
June 14th 19 at 18:24
Should be possible to avoid the line and in the list, it is very slow. Use the comfort - set(). Example:
text = 'The quick brown fox jumps over the lazy dog'
checklist = {'fox', 'dog', 'cat'}
common_words = set(text.split()) & checklist
print(common_words)

The result:
{'fox', 'dog'}

Find more questions by tags Python