0

How do I make the function output the desired output?

The search() function should return "Word found" if the word is present in the text, or "Word not found", if it’s not. https://code.sololearn.com/cJZOh4xfOrrG/?ref=app

30th Jun 2022, 3:49 PM
Tshegofatso Sekgothe
2 odpowiedzi
+ 4
Please delete this duplicate question because you have already asked here https://www.sololearn.com/Discuss/3053700/?ref=app
30th Jun 2022, 4:13 PM
A͢J
A͢J - avatar
+ 1
text = input() word = input() x = text.split(' ') def search(x, word): for a in x: if a in word: return "Word found" else: return "Word not found" print(search(x, word)) #just placed in in if condition..
1st Jul 2022, 3:04 AM
Mihir Lalwani
Mihir Lalwani - avatar