I’m trying to search for a word within string.
Example
match = 'File'
s2 = 'name of File: is .jpg'
if match not in s2:
print 'ok'
And it worked. Can I do this with list?
match = ['File','Category']
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Of course you can. So we check for each word in
matchif that word is there ins2or not.or a simple one-liner –