Multiple Substrings in String - Python -


why wouldn't code return "true" if of substrings located in larger somestring?

substring1 = "foo" substring2 = "text" somestring = "texting"  if ((substring1 or substring2) in somestring):     print "true" 

i've looked any() function don't think it's i'm looking for.


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -