I have come across this:
item = someSortOfSelection()
if item in myList:
doMySpecialFunction(item)
but sometimes it does not work with
Definition and Usage
the count() method returns the number of elements with the specified value.
Syntax
list.count(value)
example:
fruits = ['apple', 'banana', 'cherry']
x = fruits.count("cherry")
Question's example:
item = someSortOfSelection()
if myList.count(item) >= 1 :
doMySpecialFunction(item)