+3 votes
in Class 11 by kratos

Write a program to determine if the given word is present in the string.

1 Answer

+2 votes
by kratos
 
Best answer

def wsearch ( ) :

imprt re

word = ‘good’

search1 = re.search (word, ‘I am a good person’) if search1 :

position = search1.start ( )

print “matched”, word, “at position”, position

else :

print “No match found”

...