0

Help for this code please

text =input() word =input() def search (text,word) : if text.find(word) > 0 : print ("Word found") else : print ("Word not found") print(search (text,word)) """You’re working on a search engine. Watch your back Google! The given code takes a text and a word as input and passes them to a function called search(). The search() function should return "Word found" if the word is present in the text, or "Word not found", if it’s not. Sample Input "This is awesome" "awesome" Sample Output Word found"""

14th Oct 2022, 9:03 PM
Ben Hamida Mohamed Amine
Ben Hamida Mohamed Amine - avatar
4 Answers
+ 3
Asked to do "Search function should return ... ". So instead of printing in function, return the string.
14th Oct 2022, 9:11 PM
Jayakrishna 🇼🇳
+ 1
It outputs for example : Word found none And the expected output : Word found
14th Oct 2022, 9:22 PM
Ben Hamida Mohamed Amine
Ben Hamida Mohamed Amine - avatar
+ 1
Thanks for help
14th Oct 2022, 9:25 PM
Ben Hamida Mohamed Amine
Ben Hamida Mohamed Amine - avatar
0
Yes. Default return is none. Instead of print( "Word found") Write return "Word found" #apply both cases
14th Oct 2022, 9:24 PM
Jayakrishna 🇼🇳