python 2.7 - Check whether a string contains a specific word -


sorry if duplicate, looked around , couldn't find needs. complete beginner python, , wondering if there way analyze string words using built in modules. appreciated. thanks.

here function returns true if can find word in string, , false if can't.

def iswordin(word, string):     return not(string.find(word) == -1) 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -