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
2 Answers
+ 4
Please delete this duplicate question because you have already asked here
https://www.sololearn.com/Discuss/3053700/?ref=app
+ 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..