I have come across this:
item = someSortOfSelection()
if item in myList:
doMySpecialFunction(item)
but sometimes it does not work with
You may want to use one of two possible searches while working with list of strings:
if list element is equal to an item ('example' is in ['one','example','two']):
if item in your_list: some_function_on_true()
'ex' in ['one','ex','two'] => True
'ex_1' in ['one','ex','two'] => False
if list element is like an item ('ex' is in ['one,'example','two'] or 'example_1' is in ['one','example','two']):
matches = [el for el in your_list if item in el]
or
matches = [el for el in your_list if el in item]
then just check len(matches)
or read them if needed.