how to check if a word is in a list python code example
Example 1: check if word contains a word in a list python
if any(word in 'some one long two phrase three' for word in list_):
Example 2: if string is in array python
if item in my_list:
# whatever
Example 3: python how to check in a list
# app.py
listA = ['Stranger Things', 'S Education', 'Game of Thrones']
if 'Dark' in listA:
print("Yes, 'S Eductation' found in List : ", listA)
else:
print("Nope, 'Dark' not found in the list")