So basically I want to write a function which checks if the list contains a given as parameter value.
For example:
l = ['ala', 'bala', 'alabala']
So basically I want to write a function which checks if the list contains a given as parameter value.
For example:
l = ['ala', 'bala', 'alabala']
Simple function:
def isIn(item, list):
return(item in list)
l = ['ala', 'bala', 'alabala']
print(isIn('bala',l))
As an example. Please google the answer before posting the question, or try to show what you have tried in the future.
Fastest way to check if a value exist in a list
Shows any number of ways to do this