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))

23rd Aug 2021, 11:45 AM
Jocelin Kisenga
Jocelin Kisenga - avatar
2 Answers
+ 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.
23rd Aug 2021, 12:01 PM
Ipang
+ 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))
23rd Aug 2021, 12:00 PM
Atul [Inactive]