Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python find word in list

ls = ['Hello from AskPython', 'Hello', 'Hello boy!', 'Hi']
 
matches = [match for match in ls if "Hello" in match]
 
print(matches)
Source by www.askpython.com #
 
PREVIOUS NEXT
Tagged: #python #find #word #list
ADD COMMENT
Topic
Name
1+6 =