0
pls help me, where is the problem on this code?
def search (text, word): if text.find(word) >= 1: return "word found" else: return "word not found" text = input() word = input() print(search(text,word))
2 ответов
+ 2
Try this as condition
if text.find( word ) > -1:
And make sure that the returned string be in the right form, *exactly* as the task requirement specified.
+ 1
def search (text, word):
if text.find(word):
return "word found"
else:
return "word not found"
text = input()
word = input()
print(search(text,word))