python - List of strings in string -



python - List of strings in string -

how can write look in python checks if string contains of strings provided. this:

s = 'winter summer spring fall' # fall , spring i_like = 'fall', 'spring' in s

use built in any function:

i_like = any(i in s in ('fall', 'spring'))

this checks if of elements in tuple in string.

python

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -